Skip to content

Python: Autoformat all .ql files.#3156

Merged
RasmusWL merged 3 commits into
github:masterfrom
tausbn:python-autoformat-all-ql-files
Mar 30, 2020
Merged

Python: Autoformat all .ql files.#3156
RasmusWL merged 3 commits into
github:masterfrom
tausbn:python-autoformat-all-ql-files

Conversation

@tausbn
Copy link
Copy Markdown
Contributor

@tausbn tausbn commented Mar 30, 2020

I did not vet these files as thoroughly as the .qll files, but I don't think it's likely that there are any problems hiding in these.

I would suggest looking at a few random files, and if nothing looks out of order just going ahead with the merge. We can always fix up any problems at a later date.

@tausbn tausbn added the Python label Mar 30, 2020
@tausbn tausbn requested a review from a team as a code owner March 30, 2020 10:44
@tausbn tausbn requested review from RasmusWL and removed request for a team March 30, 2020 10:44
How could the tests fail because of autoformatting, you may ask?

The answer is deprecation warnings. These specify the location of the deprecated
entity, and due to autoformatting these moved around.
Copy link
Copy Markdown
Member

@RasmusWL RasmusWL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at some ~20 files, and it all looks good to me!

predicate does_nothing(PyFunctionObject f) {
not exists(Stmt s | s.getScope() = f.getFunction() |
not s instanceof Pass and not ((ExprStmt)s).getValue() = f.getFunction().getDocString()
not s instanceof Pass and not s.(ExprStmt).getValue() = f.getFunction().getDocString()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow that is SUPER NICE ❤️

@RasmusWL RasmusWL merged commit 0b4bfed into github:master Mar 30, 2020
@tausbn tausbn deleted the python-autoformat-all-ql-files branch February 12, 2021 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants