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

Use flake8 #93

Merged
merged 32 commits into from Feb 2, 2019
Merged

Use flake8 #93

merged 32 commits into from Feb 2, 2019

Conversation

jakirkham
Copy link
Member

Updates the test suite to use flake8 to lint the code as part of the pytest run. Also fixes several errors caught by running flake8.

As the tests make use of flake8 (specifically a pytest plugin for
flake8), require `flake8` and `pytest-flake8`.
Uses the flake8 plugin for pytest to ensure that flake8 checks are run
as part of pytest.
These imports were probably used for code that no longer needs them. So
go ahead and drop these unused imports.
Running flake8 picked out this line as too long. This wraps it some to
try and fix this issue.
To fit the 79 character limit constraint, split this warning into two
strings on two lines that are concatenated.
Some internal imports are unused according to flake8. So we drop them
here to fix these flake8 errors.
To workaround flake8 unused import errors where we know these functions
are imported and used elsewhere, go ahead and perform trivial
assignments to make use of these functions. This still passes the tests
and removes the flake8 errors.
Make sure that all imports in `ndfilters` happen before other statements
to fix flake8 errors.
We are not really interested in flake8's `lambda` assignment rule in
these cases. So simply tell flake8 to ignore these lines.
Removes the need for the `\`, which seems to be causing issues with
`flake8`.
For some reason disabling this flake8 error on the second line is not
sufficient. So disable it on the first lines as well.
This `noqa` seems to have no effect. So just drop it to avoid having
these in excess.
As flake8 complains the line length is too long here, wrap these
arguments to fit them within the recommended line length.
To fit the recommended line length, wrap the test function's
parameterized arguments.
We are not really interested in flake8's `lambda` assignment rule in
these cases. So simply tell flake8 to ignore these lines.
As flake8 complains the line length is too long here, wrap these
arguments to fit them within the recommended line length.
As flake8 complains the line length is too long here, wrap these
arguments to fit them within the recommended line length.
We are not really interested in flake8's `lambda` assignment rule in
these cases. So simply tell flake8 to ignore these lines.
We are not really interested in flake8's `lambda` assignment rule in
these cases. So simply tell flake8 to ignore these lines.
As the `operator` module is not being used in this test module, drop it
from the imports.
These are a little annoying to wrap currently. So simply tell flake8 to
not worry about these.
As Python 3.5 is not supported in conda-forge any more, this uses the
slightly older versions of packages that work with Python 3.5 in order
to run the flake8 tests there as well.
As the `[pytest]` section in `setup.cfg` seems to be deprecated and
raises errors when used with newer pytest versions, switch to using
`[tool:pytest]` instead. This seems to work ok even with old versions of
pytest used with Python 3.5.
As flake8 did not like how this line was formatted, we simplify it a bit
and adjust the indentation to make it happier.
As flake8 did not like how this line was formatted, we simplify it a bit
and adjust the indentation to make it happier.
@jakirkham jakirkham merged commit d5bac99 into dask:master Feb 2, 2019
@jakirkham jakirkham deleted the use_flake8 branch February 2, 2019 07:18
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.

None yet

1 participant