Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completes flake8 linting of Python files #66

Merged
merged 6 commits into from
Feb 6, 2018
Merged

Conversation

conorsch
Copy link
Contributor

@conorsch conorsch commented Feb 2, 2018

Follow-up to #62, which falsely alleged it linted "all" Python files. It didn't: it only ran flake8 ., and trusted flake8 to discover all Python files. Here, we add a find command to discover Python files, which catches scripts and other helpers that do not end in *.py.

Changes are quite cosmetic, but it's still worth running the test suites locally to ensure no breakage. In particular, don't forget to run the integration tests in the sd-journalist VM, as described in the README.

Conor Schaefer added 6 commits February 2, 2018 19:18
For real this time! Added a `find` command to run `file` on every file
and execute flake8 on any that `file` identifies as a Python script.
Still running the `flake8 .` command separately. The disadvantage to
this approach is that there are two flake8 runs, so errors in the first
will cause the Makefile target to exit, without checking the other
files. That's acceptable: we'll still catch errors in CI and locally,
although it may take two runs of `make flake8` in order to catch them.
All changes were cosmetic, specifically whitespace-related.
Changes are cosmetic, specifically whitespace-related. Modified some
command calls by creating a "cmd" variable to aid in readbility (and
prevent overly long lines).
Includes changes to multiple scripts under `sd-journalist/`, for Flake8
compliance. Changes were cosmetic.
Substantial diff here, but changes are almost entirely cosmetic.
Moved the sys.path.insert call to below the module imports,
to resolve several E402s violations.
Only newer versions of Flake8 throw an E305 when two newlines are
missing from *after* a function or class declaration. Should be in line
with what we're using in CI (which is not pinned to a specific version
of flake8 at present).
@@ -111,7 +128,7 @@ if __name__ == '__main__':
d.show()

if sigfile != "":
# tyvm https://stackoverflow.com/questions/6215690/how-to-execute-a-method-automatically-after-entering-qt-event-loop
# tyvm https://stackoverflow.com/questions/6215690/how-to-execute-a-method-automatically-after-entering-qt-event-loop # noqa: E501
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm? noqa?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, noqa on E501 permits the extra-long line. I'd much rather skip linting on a URL than break the URL up over multiple lines in order to satisfy the linter!

@joshuathayer
Copy link
Contributor

This looks great to me. I'll run tests once my #67 review is done and if they pass, :shipit:

@joshuathayer joshuathayer reopened this Feb 6, 2018
Copy link
Contributor

@joshuathayer joshuathayer left a comment

Choose a reason for hiding this comment

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

Tests pass, looks good, ship it!

@conorsch conorsch merged commit b1ee410 into master Feb 6, 2018
charles-boyd pushed a commit to charles-boyd/securedrop-workstation that referenced this pull request Sep 5, 2018
…ke8-linting

Completes flake8 linting of Python files
@legoktm legoktm deleted the continue-flake8-linting branch May 28, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants