cachetools icon indicating copy to clipboard operation
cachetools copied to clipboard

Configure flake8 to include -- not exclude -- chosen paths

Open kurtmckee opened this issue 1 year ago • 3 comments

After cloning the cachetools repo, I created a virtual environment named .venv/ and ran the test suite. The flake8 test failed because it scanned the entire .venv/ subdirectory, which was not listed as an excluded directory.

To prevent this type of failure, this PR switches from an exclusion list to an include list.

Note that flake8 only supports exclusions as a configurable option; inclusions must be specified on the command line.

kurtmckee avatar Sep 18 '23 14:09 kurtmckee

Codecov Report

Merging #281 (dddd2b0) into master (44a1edc) will not change coverage. Report is 2 commits behind head on master. The diff coverage is n/a.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff            @@
##            master      #281   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          666       666           
=========================================
  Hits           666       666           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Sep 18 '23 20:09 codecov-commenter

Also quite interesting - maybe not something I'll have a shot at right now, because I have to understand the pros and cons, but thanks for your input!

tkem avatar Sep 18 '23 20:09 tkem

Sure thing!

To recreate the issue I was encountering (not in this particular branch), you can run these basic commands:

# Create the virtual environment
python -m venv .venv

# Activate the virtual environment, assuming Linux or macOS
source .venv/bin/activate

# Install the project in editable mode
python -m pip install -e .

# Run flake8 in the test suite
tox -e flake8

kurtmckee avatar Sep 18 '23 21:09 kurtmckee

Hi Thomas! I hope your year is off to a good start.

I'm going to close this PR to reduce cognitive load for the both of us.

Thanks for your work on cachetools!

kurtmckee avatar Mar 05 '24 22:03 kurtmckee