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

Add isort import style linter #217

Merged
merged 7 commits into from Jan 30, 2019

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Member

commented Jan 30, 2019

As discussed in #212 (comment), this pull request adds the isort linter to ensure that all the import styles are always consistent.

The linter is configured to follow the PEP-8 import style such as having separate blocks for standard library, third party and own imports, etc. Additionally, the linter is configured to force imports to be one per line to ensure that diffs are clean (e.g. adding or removing an import will be an easily visible full line diff instead of intermingled with other imports).

Editor plugins to automatically run isort are also available.

All Submissions:

  • Have you followed the guidelines in our Contributing document?

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

  • Does your PR follow our Code of Conduct?

  • Have you added an explanation of what your changes do and why you'd like us to include them?

  • Does each method or function "do one thing well"? Reviewers may recommend methods be split up for maintainability and testability. Not applicable: linting change

  • Is this code designed to be testable? Not applicable: linting change

  • Is the code documented well? Not applicable: linting change

  • Does your submission pass existing tests (or update existing tests with documentation regarding the change)?

  • Have you added tests to cover your changes? Not applicable: linting change

  • Have you linted your code prior to submission?

  • Have you updated the documentation and README? Not applicable: linting change

  • Is PII treated correctly? In particular, make sure the code is not logging objects or strings that might contain PII (e.g. request headers). Not applicable: linting change

  • Have secrets been stripped before committing? Not applicable: linting change

@c-w c-w referenced this pull request Jan 30, 2019

Merged

Add tool to send events #212

13 of 13 tasks complete

@c-w c-w force-pushed the isort branch 3 times, most recently from 9192306 to e6a6425 Jan 30, 2019

c-w added some commits Jan 30, 2019

Avoid linting templates
For some reason this doesn't work if the option is set in setup.cfg,
likely because the special characters in the template path confuse the
isort tool.

@c-w c-w force-pushed the isort branch from 0b18ef1 to 0a77df6 Jan 30, 2019

@sayar

sayar approved these changes Jan 30, 2019

@sayar sayar merged commit 03cd0e6 into master Jan 30, 2019

4 checks passed

agogosml-app-ci Build #20190130.10 succeeded
Details
agogosml-ci Build #20190130.18 succeeded
Details
agogosml-cli-ci Build #20190130.13 succeeded
Details
license/cla All CLA requirements met.
Details

@sayar sayar deleted the isort branch Jan 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.