Adjust for new linux baseline
[LibreOffice.git] / bin / check-implementer-notes.py
blobe637563d2f861cf42da216141103b96f7c4db81c
1 #!/usr/bin/env python
3 import json, re, subprocess, sys, urllib3
5 http = urllib3.PoolManager()
7 # TDF implementer notes pages for LibreOffice
8 wiki_pages = [
9 'https://wiki.documentfoundation.org/api.php?action=parse&format=json&page=Development/ODF_Implementer_Notes/List_of_LibreOffice_ODF_Extensions&prop=wikitext',
10 'https://wiki.documentfoundation.org/api.php?action=parse&format=json&page=Development/ODF_Implementer_Notes/List_of_LibreOffice_OpenFormula_Extensions&prop=wikitext']
12 # get all commit hashes mentioned in implementer notes
13 wiki_commit_hashes = {}
14 query = re.compile(r'\{\{commit\|(\w+)\|\w*\|\w*\}\}', re.IGNORECASE)
15 for page in wiki_pages:
16 r = http.request('GET', page)
17 data = json.loads(r.data.decode('utf-8'))
18 for line in data['parse']['wikitext']['*'].split('\n'):
19 for res in query.finditer(line):
20 wiki_commit_hashes[res.group(1)] = ''
22 # get all commits that change core/schema/* - and are _not_ mentioned
23 # in the wiki page
24 # Cut-off is May 18th 2020, when Michael Stahl had finished cleaning this up
25 for commit in subprocess.check_output(
26 ['git', '--no-pager', '-C', sys.path[0]+'/..', 'log',
27 '--since=2020-05-18', '--format=%H', '--', 'schema/'],
28 stderr=subprocess.STDOUT).decode("utf-8").split("\n"):
29 if commit != '' and commit not in wiki_commit_hashes:
30 print('missing commit: %s' % commit)