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

Travis CI: make lint-diff mandatory #3743

Merged
merged 6 commits into from
Aug 31, 2020
Merged

Travis CI: make lint-diff mandatory #3743

merged 6 commits into from
Aug 31, 2020

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Aug 26, 2020

Improved automated testing

  • Run 450+ Python doctests on all Travis CI runs
  • Run tests on Python 3.9 release candidate 1 in allow_failures mode.
  • Drop an obsolete Python 3.8 run that is surpassed by normal test runs.

Technical

Testing

Screenshot

Stakeholders

@cclauss cclauss requested a review from cdrini August 26, 2020 23:08
@cclauss cclauss changed the title Travis CI: Add Python doctests and Python 3.9 final candidate Travis CI: Add Python doctests and Python 3.9 release candidate Aug 26, 2020
@cdrini cdrini self-assigned this Aug 27, 2020
# On pull requests, run all flake8 tests on modified code
# if clause avoids `fatal: ambiguous argument 'origin/master'` on git push
- if [ "$TRAVIS_EVENT_TYPE" == "pull_request" ]; then
make lint-diff;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is different; this runs the more aggressive flake8 against the diff, no? We still want that (unless our code has become compatible with the stricter flake8 config)

Copy link
Contributor Author

@cclauss cclauss Aug 28, 2020

Choose a reason for hiding this comment

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

A failure of make lint-diff does not currently fail the Travis CI test run.
There are two issues with the way that we are running make lint-diff:

  1. The Travis build passes even when make lint-diff fails.
  2. Flake8 is choking when handed binary data like .mrc files.

I believe that these two issues are easy to fix but we would start failing the build when contributors fix typos. I believe that we would be better served by blackening our code before we make make lint-diff mandatory. If not, we will frustrate our contributors with rework. Manual rework may cause bugs. If we do not blacken first then we will spend a lot of code review time on educating contributors on code formatting rules related to parts of the lines that they do not wish to change.

Copy link
Collaborator

@cdrini cdrini Aug 31, 2020

Choose a reason for hiding this comment

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

Yeah, let's enable this + make it mandatory. I don't think it'll be that annoying, since it'll only complain about the lines people are editing.

To fix 2, would adding a --filename=*.py to scripts/flake8-diff.sh do the trick?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should consider blackening our code in the future, but not sure this is the best time considering how many things we have on our plate 😅

.travis.yml Outdated Show resolved Hide resolved
@cclauss cclauss changed the title Travis CI: Add Python doctests and Python 3.9 release candidate Travis CI: make lint-diff mandatory Aug 31, 2020
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Awesome! Let's give that a shot :)

@cdrini cdrini merged commit 772ee62 into internetarchive:master Aug 31, 2020
@cclauss cclauss deleted the doctests-and-python-3.9 branch September 1, 2020 04:15
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