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

Introduced pre-commit functionality #142

Merged
merged 7 commits into from
Jun 7, 2022

Conversation

marksweb
Copy link
Member

@marksweb marksweb commented Nov 2, 2021

First thing I've done here is to bring tox and the setup classifiers inline with the python versions we're actually testing against; Python 3.7, 3.8, 3.9.

Then I've added testing against CMS 3.9

The main feature here though is the addition of pre-commit hooks. The github actions are currently running flake8 and isort, so it makes sense to have these run as pre-commit hooks. I've also introduced pyupgrade which can be set to a target version (3.7 given that's the base version for testing against) and it will upgrade python code to suit if there are things that can be done better. A lot of the changes here come from pyupgrade & are automated by that tool.

* B007 Loop control variable 'x' not used within the loop body. If this is intended, start the name with an underscore.
* N400: Found backslash that is used for line breaking
* C408 Unnecessary tuple call - rewrite as a literal.
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2021

Codecov Report

Merging #142 (5d3fa46) into master (b01151e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #142   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           71        71           
  Lines         1211      1211           
  Branches        65        65           
=========================================
  Hits          1211      1211           
Impacted Files Coverage Δ
...tstrap4/contrib/bootstrap4_carousel/cms_plugins.py 100.00% <ø> (ø)
...ootstrap4/contrib/bootstrap4_carousel/constants.py 100.00% <ø> (ø)
djangocms_bootstrap4/constants.py 100.00% <100.00%> (ø)
...ootstrap4/contrib/bootstrap4_alerts/cms_plugins.py 100.00% <100.00%> (ø)
...cms_bootstrap4/contrib/bootstrap4_alerts/models.py 100.00% <100.00%> (ø)
...bootstrap4/contrib/bootstrap4_badge/cms_plugins.py 100.00% <100.00%> (ø)
...ocms_bootstrap4/contrib/bootstrap4_badge/models.py 100.00% <100.00%> (ø)
..._bootstrap4/contrib/bootstrap4_card/cms_plugins.py 100.00% <100.00%> (ø)
...gocms_bootstrap4/contrib/bootstrap4_card/models.py 100.00% <100.00%> (ø)
...s_bootstrap4/contrib/bootstrap4_carousel/models.py 100.00% <100.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b01151e...5d3fa46. Read the comment docs.

@NicolaiRidani NicolaiRidani requested a review from a team November 9, 2021 16:48
@marksweb
Copy link
Member Author

Alongside these pre-commit setups, it'd be ideal to also include pre-commit CI to keep the versions of hooks updated;
https://github.com/marketplace/pre-commit-ci/plan/MDIyOk1hcmtldHBsYWNlTGlzdGluZ1BsYW42MTI2#pricing-and-setup

(This needs to be installed to the repos as we merge these hooks)

@marksweb marksweb merged commit 3232e7a into django-cms:master Jun 7, 2022
@marksweb marksweb deleted the feature/pre-commit branch June 7, 2022 01:22
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.

None yet

2 participants