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

Align local pre-commit with CI-based linting (Tox and Travis) #6583

Merged
merged 9 commits into from
Feb 27, 2020

Conversation

benjaoming
Copy link
Contributor

@benjaoming benjaoming commented Feb 19, 2020

Summary

  • Removes frontendlint and pythonblack tox entries (they are now part of "pythonlint3")
  • ...also removes said entries from Travis, hence quicker
  • All calls to pre-commit now happen through the same configuration
  • Caching on travis potentially improved

Does anyone else get frustrated when their code breaks a CI linting check because black isn't in pre-commit?

Having it in pre-commit is much faster, as it just lints changed files.

Reviewer guidance

I didn't care to pin the black version. Does it matter?

Edit: We use Black without pinning in tox.ini as well, so we always run the latest version.

References

This partly solves #5409


Contributor Checklist

PR process:

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Testing:

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

Reviewer Checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@benjaoming benjaoming added TODO: needs review Waiting for review DEV: dev-ops Continuous integration & deployment labels Feb 19, 2020
@codecov
Copy link

codecov bot commented Feb 19, 2020

Codecov Report

Merging #6583 into develop will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted Files Coverage Δ
kolibri/core/content/utils/check_schema_db.py 100.00% <0.00%> (+8.69%) ⬆️

@benjaoming benjaoming changed the title Adding black to pre-commit All linting done through pre-commit (Tox and Travis) Feb 19, 2020
tox.ini Show resolved Hide resolved
@benjaoming
Copy link
Contributor Author

This is waiting for the other PRs to be merged, only then can we get the green lights from Travis ☁️ 🚥

@benjaoming benjaoming changed the title All linting done through pre-commit (Tox and Travis) Align local pre-commit with CI-based linting (Tox and Travis) Feb 20, 2020
benjaoming pushed a commit to benjaoming/kolibri that referenced this pull request Feb 21, 2020
benjaoming pushed a commit that referenced this pull request Feb 22, 2020
Linting overlooked broken rules from previous run of #6583
@benjaoming benjaoming mentioned this pull request Feb 24, 2020
9 tasks
Copy link
Contributor

@indirectlylit indirectlylit left a comment

Choose a reason for hiding this comment

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

I'm a bit confused how it "knows" to use a py3 venv for black - e.g. where would this be specified?

However I tested with a py2.7 environment and confirmed that it seems to work

@benjaoming
Copy link
Contributor Author

I'm a bit confused how it "knows" to use a py3 venv for black - e.g. where would this be specified?

I think it's in the hooks configuration:

https://github.com/psf/black/blob/master/.pre-commit-hooks.yaml

@indirectlylit indirectlylit merged commit 4070dc1 into learningequality:develop Feb 27, 2020
nucleogenesis pushed a commit to nucleogenesis/kolibri that referenced this pull request Mar 10, 2020
nucleogenesis pushed a commit to nucleogenesis/kolibri that referenced this pull request May 20, 2020
nucleogenesis pushed a commit to nucleogenesis/kolibri that referenced this pull request May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: dev-ops Continuous integration & deployment TODO: needs review Waiting for review TODO: needs updates Needs changes based on review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants