s-weigand / flake8-nb

Flake8 checking for jupyter notebooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Excluded directory is checked.

1kastner opened this issue · comments

Describe the bug
Directories that I want to exclude and that were previously excluded are not scanned by flake8_nb.

To Reproduce
Steps to reproduce the behavior:

  1. Create a .flake8_nb file with the following content:
exclude =
    *.git*
    *venv*
    *.ipynb_checkpoints*
    *.virtual_documents*
    *build*
    *.py
  1. Run flake8_nb from the CI
  2. Observe how it enters the directory .virtual_documents where it should not end up!

Expected behavior
The excluded directories, such as .virtual_documents , should not be checked.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: flake8_nb-0.5.1

Additional context
This was working with flake8-nb-0.4.0

I additionally checked and yes, downgrading to 0.4.0 made my config work again.

Btw, I also came up with that config by try-and-error, my flake8 config does not incude those asterisks.

When hacking the flake8 config module I forgot to also replace the hardcoded .flake8 🤦‍♀️

I will add a fix+test and make a new release

Cool, thanks!

@s-weigand do you see the option to add some automated test for this to avoid future regression? That would be awesome! Maybe inside https://github.com/s-weigand/flake8-nb/tree/main/tests/data there could be a subfolder that is used as a root folder to run flake8_nb and it is checked whether .flake8_nb has been read in and used?

@1kastner I added a test for that in #255 when fixing the issue 😊
Due to how the config section discovery works you might need to add [flake8_nb] on the top of your .flake8_nb not sure if that was needed before 🤔
I use setup.cfg, pyproject.toml and tox.ini for all my configs if the tool allows it

Anyway 0.5.2 is on PyPi and should fix the bug 🎉

That's great, thanks a lot!