django-cms / djangocms-bootstrap4

django CMS Bootstrap 4 is a plugin bundle for django CMS providing several components from the popular Bootstrap 4 framework.
https://www.django-cms.org/
Other
82 stars 58 forks source link

Introduced pre-commit functionality #142

Closed marksweb closed 2 years ago

marksweb commented 2 years ago

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.

codecov-commenter commented 2 years ago

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.

marksweb commented 2 years ago

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)