Testing the fixes for T270452: Add more preflight checks to makerelease2
Invalid JSON:
Linting PHP and JSON files for sanity...
Traceback (most recent call last):
File "/var/www/wiki/mediawiki/tools/release/make-release/scap_lint.py", line 71, in check_valid_json_file
json.load(json_file)
File "/usr/lib/python3.8/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 7 column 2 (char 168)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./makerelease2.py", line 269, in <module>
main()
File "./makerelease2.py", line 264, in main
archive(args.repository, args.tag, args.output_dir, args.previous, sign=args.sign,
File "./makerelease2.py", line 95, in archive
scap_lint.check_valid_syntax('.', procs=multiprocessing.cpu_count())
File "/var/www/wiki/mediawiki/tools/release/make-release/scap_lint.py", line 57, in check_valid_syntax
check_valid_json_file(abspath)
File "/var/www/wiki/mediawiki/tools/release/make-release/scap_lint.py", line 73, in check_valid_json_file
raise ValueError("%s is an invalid JSON file" % path)
ValueError: ./composer.json is an invalid JSON fileThat works.
Text before <?php
Linting PHP and JSON files for sanity...
Traceback (most recent call last):
File "./makerelease2.py", line 269, in <module>
main()
File "./makerelease2.py", line 264, in main
archive(args.repository, args.tag, args.output_dir, args.previous, sign=args.sign,
File "./makerelease2.py", line 95, in archive
scap_lint.check_valid_syntax('.', procs=multiprocessing.cpu_count())
File "/var/www/wiki/mediawiki/tools/release/make-release/scap_lint.py", line 56, in check_valid_syntax
check_php_opening_tag(abspath)
File "/var/www/wiki/mediawiki/tools/release/make-release/scap_lint.py", line 115, in check_php_opening_tag
raise ValueError("%s has content before opening <?php tag" % path)
ValueError: ./index.php has content before opening <?php tagThat works too.
But if we make an invalid php file (index.php again)....
Linting PHP and JSON files for sanity...
Traceback (most recent call last):
File "./makerelease2.py", line 269, in <module>
main()
File "./makerelease2.py", line 264, in main
archive(args.repository, args.tag, args.output_dir, args.previous, sign=args.sign,
File "./makerelease2.py", line 95, in archive
scap_lint.check_valid_syntax('.', procs=multiprocessing.cpu_count())
File "/var/www/wiki/mediawiki/tools/release/make-release/scap_lint.py", line 50, in check_valid_syntax
subprocess.check_call(cmd, shell=True)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'find -O2 '.' -not -type d -name '*.php' -not -name 'autoload_static.php' -or -name '*.inc' | xargs -n1 -P2 -exec php -l >/dev/null 2>&1' returned non-zero exit status 124.This error isn't very helpful, beyond knowing something is seemingly wrong :(