Skip to content

Conversation

@steve148
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Right now the prec-commit check confirms that functions pass the flake8 and flake8-docstring linter checks, while the github action CI checks confirm that flake8, flake8-black, and flake8-isort run. This means there is an inconsistentcy between the linter checks run locally and the ones run remotely.

What is the new behavior?

Now the flake8 extensions are consistent between the pre-commit and remote CI runners.

Does this PR introduce a breaking change?

No breaking change 🎉

Other information

Sorry for making this mistake 😢

@steve148 steve148 self-assigned this Mar 10, 2020
@steve148 steve148 added chore Things that improve the project but aren't necessarily new features. bug Something isn't working labels Mar 10, 2020
Copy link
Contributor

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

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

How did you figure out github action CI checks confirm that flake8, flake8-black, and flake8-isort? And what flake8-isort is for?

"pre-commit",
"black",
"flake8",
"flake8-docstrings",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand how flake8-docstrings has been configured above without this dev dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok so pre-commit's libraries / dependencies are separate from pip. So in the pre-commit config above, the repo field lists the place where pre-commit would pull the code from and it handles how it packages / manages versions of libraries which do checks.

If we want python / python to be the only thing that handles dependencies we could make these checks run against the local repository. We would move the checks under the repo: local grouping.

@steve148
Copy link
Contributor Author

@DaleSeo I originally figured it out just by comparing the pre commit config file to the setup.py file to see if there were a mismatch.

To test, in my forked version of the repo I branched off of my fix branch and confirmed a few of the different checks both locally with pre-commit and remotely with github actions. I made sure pre-commit would complain when expected, then I would commit with the --no-verify option to force the commit to the remote server. There I would confirm that the remote check failed. If you want to check, in my forked repo you'll see a failed version of the check at https://github.com/steve148/python-graphql-client/runs/498862259?check_suite_focus=true.

isort is a utility library for ordering python imports in a file. According to PEP-8 the import order should be standard library, third party libraries, and then local files / modules. If you're using VSCode it provides a command called something like Organize your imports which uses isort to automatically sort the imports using isort.

@steve148 steve148 merged commit 36f6f92 into prodigyeducation:master Mar 10, 2020
@steve148 steve148 deleted the fix/flake8-consistent-checks branch March 10, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chore Things that improve the project but aren't necessarily new features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants