AstraZeneca / rexmex

A general purpose recommender metrics library for fair evaluation.
https://rexmex.readthedocs.io/
278 stars 25 forks source link

Use `flake8` to test that `black` has been applied #11

Closed cthoyt closed 2 years ago

cthoyt commented 2 years ago

Summary

This PR makes changes to ensure that black is consistently applied. I assume this is the intent since it's part of the pre-commit configuration, but as I was skimming the code, I noticed it hadn't been applied in some places.

Changes

  1. Adds a tox.ini configuration with the following environments:
    1. testenv:lint can be run with tox -e lint and will apply black to all Python source files in the repo.
    2. testenv:flake8 can be run with tox -e flake8 and will run the flake8 linter tool to all Python source files in the repo. It currently has the --select BLK100 option so it only enforces that black has been run. This could be removed in the future to enforce additional flake8 testing.
  2. Adds the installation of tox and application of tox -e flake8 in the main GitHub Action
  3. Applies black so as to pass the tes.
codecov-commenter commented 2 years ago

Codecov Report

Merging #11 (9f9d70e) into main (972b695) will not change coverage. The diff coverage is 98.85%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #11   +/-   ##
=======================================
  Coverage   99.57%   99.57%           
=======================================
  Files          13       13           
  Lines         475      475           
=======================================
  Hits          473      473           
  Misses          2        2           
Impacted Files Coverage Δ
rexmex/__init__.py 100.00% <ø> (ø)
rexmex/metrics/__init__.py 100.00% <ø> (ø)
rexmex/scorecard.py 95.23% <85.71%> (ø)
rexmex/dataset.py 100.00% <100.00%> (ø)
rexmex/metrics/classification.py 100.00% <100.00%> (ø)
rexmex/metrics/rating.py 100.00% <100.00%> (ø)
rexmex/metricset.py 98.48% <100.00%> (ø)
rexmex/utils.py 100.00% <100.00%> (ø)
tests/integration/test_aggregation.py 100.00% <100.00%> (ø)
tests/unit/test_dataset.py 100.00% <100.00%> (ø)
... and 12 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 972b695...9f9d70e. Read the comment docs.