Page MenuHomePhabricator

scap invalid JSON/PHP shebang check doesn't work if not syncing a directory
Closed, ResolvedPublic

Description

scap has functionality to lint JSON and PHP files as a last-ditch safety measure to prevent invalid JSON or PHP files from being synced to the cluster. However, it doesn't work if you are syncing *just* that invalid file.

scap sync-file invalid.json, will end up calling os.walk('invalid.json') which doesn't work since you can only walk directories, so no file is linted at all.

Event Timeline

Legoktm triaged this task as High priority.

Change 657921 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/scap@master] lint: Handle individual files being passed to check_valid_syntax()

https://gerrit.wikimedia.org/r/657921

Change 657921 merged by jenkins-bot:
[mediawiki/tools/scap@master] lint: Handle individual files being passed to check_valid_syntax()

https://gerrit.wikimedia.org/r/657921