-
Notifications
You must be signed in to change notification settings - Fork 16
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 linting stage to Travis CI build #55
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Makes use of the concept of "stages" on Travis CI. There is one stage each here for linting, testing, and deploying. The deploy stage is now cut off at the pass if the target is not a tag from the master branch, so the build should be slightly faster.
Stages get the first Python listed by default, but black can only run in Python 3.6+. Also make sure that black checks against 3.4-compatible syntax (black should also be run with this flag when transforming files).
Reformat the code using black to establish the baseline. Used `black -t py34 apiron tests` to produce the change.
black requires Python 3.6+ and won't even install in lower versions. Remove black from dev-requirements.txt and only install it manually in the lint stage where Python 3.6+ is guaranteed.
Add comments to .travis.yml for clarity.
Add `pyflakes` to linting stage and fix import warnings it was raising. I had previously said `import *` was fine in apiron/__init__.py, but pyflakes does get mad about that. Explode that out to the items that really are there, and list them out explicitly in `__all__`.
* Use `pyproject.toml` to configure black for all supported Python versions; this reduces likelihood of running black the wrong way * Increase line length to 120 for consistency with existing code style
michael-iden
approved these changes
Apr 22, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reformatting looks good.
maddy531
approved these changes
Apr 22, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
momo-sa
approved these changes
Apr 22, 2019
eslawski
pushed a commit
that referenced
this pull request
Jun 5, 2019
* Add linting stage to Travis CI build Makes use of the concept of "stages" on Travis CI. There is one stage each here for linting, testing, and deploying. The deploy stage is now cut off at the pass if the target is not a tag from the master branch, so the build should be slightly faster. * Reorder Pythons in Travis CI matrix and target 3.4 with black Stages get the first Python listed by default, but black can only run in Python 3.6+. Also make sure that black checks against 3.4-compatible syntax (black should also be run with this flag when transforming files). * Process code using black Reformat the code using black to establish the baseline. Used `black -t py34 apiron tests` to produce the change. * Install black in lint stage only black requires Python 3.6+ and won't even install in lower versions. Remove black from dev-requirements.txt and only install it manually in the lint stage where Python 3.6+ is guaranteed. * Document .travis.yml sections Add comments to .travis.yml for clarity. * Add note about black to CONTRIBUTING.md * Add pyflakes checks to linting stage Add `pyflakes` to linting stage and fix import warnings it was raising. I had previously said `import *` was fine in apiron/__init__.py, but pyflakes does get mad about that. Explode that out to the items that really are there, and list them out explicitly in `__all__`. * Blackify apiron/__init__.py * Update black configuration * Use `pyproject.toml` to configure black for all supported Python versions; this reduces likelihood of running black the wrong way * Increase line length to 120 for consistency with existing code style
This was referenced Jun 6, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is a: (check at least one)
Is this a breaking change? (check one)
Is the:
What does this change address?
Makes use of the concept of "stages" on Travis CI. There is one stage
each here for linting, testing, and deploying. The deploy stage is now
cut off at the pass if the target is not a tag from the master branch,
so the build should be slightly faster.
How does this change work?
black
for consistent code formattingblack --check
on the code to see if it's been properly formatted, failing if notpyflakes
for static analysispyflakes
on the code, failing if any errors found