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

exclude cannot handle directory #392

Closed
LisPrzemyslaw opened this issue Jul 25, 2024 · 4 comments · Fixed by #395
Closed

exclude cannot handle directory #392

LisPrzemyslaw opened this issue Jul 25, 2024 · 4 comments · Fixed by #395
Assignees
Labels
bug Something isn't working

Comments

@LisPrzemyslaw
Copy link

The exclude files cannot hold the whole dictionary. The regex pattern checks only for the name of the file so in a case that you have 2 similar file names but in different folders then you have to exclude both.

Replace bug:
In my case I'm using poetry so the config file looks like this:
pyproject.toml

[tool.docsig]
exclude = '''.*src\\design\\.*'''

The design folder should be excluded. But it is not. This line makes nothing.

Expected:
The whole folder is not in checks.

Possible solution:
right now in _files.py::Paths::_populate there is a regex match _re.match(i, root.name) and to proper work it should be a _re.match(i, str(name)) This will allows to check whole folders instead of only one file. It is really important if you have the same names in different folders and only one should be excluded.

Environment:

  • Python version: 3.11.4
  • docsig version: 0.59.1
@jshwi jshwi self-assigned this Jul 26, 2024
@jshwi jshwi added the bug Something isn't working label Jul 26, 2024
jshwi added a commit that referenced this issue Jul 26, 2024
@jshwi jshwi linked a pull request Jul 26, 2024 that will close this issue
jshwi added a commit that referenced this issue Jul 26, 2024
jshwi added a commit that referenced this issue Jul 26, 2024
jshwi added a commit that referenced this issue Jul 26, 2024
jshwi added a commit that referenced this issue Jul 26, 2024
@jshwi
Copy link
Owner

jshwi commented Jul 26, 2024

Hey @LisPrzemyslaw
Thanks for opening this and making the logic behind this flawed regex handling known
Are you able to check this branch and let me know how the fix looks on your end?
Cheers,
Stephen

jshwi added a commit that referenced this issue Jul 26, 2024
jshwi added a commit that referenced this issue Jul 26, 2024
Match pattern against full path instead of each part at a time

Exclude rules now also handle windows paths

Signed-off-by: Stephen Whitlock <[email protected]>
jshwi added a commit that referenced this issue Jul 26, 2024
Match pattern against full path instead of each part at a time

Exclude rules now also handle windows paths

Signed-off-by: Stephen Whitlock <[email protected]>
jshwi added a commit that referenced this issue Jul 26, 2024
Match pattern against full path instead of each part at a time

Default exclude rules now also handle windows paths

Signed-off-by: Stephen Whitlock <[email protected]>
jshwi added a commit that referenced this issue Jul 26, 2024
Match pattern against full path instead of each part at a time

Default exclude rules now also handle windows paths

Signed-off-by: Stephen Whitlock <[email protected]>
jshwi added a commit that referenced this issue Jul 26, 2024
Match pattern against full path instead of each part at a time

Signed-off-by: Stephen Whitlock <[email protected]>
@jshwi
Copy link
Owner

jshwi commented Jul 27, 2024

@LisPrzemyslaw , I'm pretty satisfied this is fixed now, I tried on mac and my windows vm
I'll make this available now as v0.59.2
Any issues please don't hesitate to let me know

@LisPrzemyslaw
Copy link
Author

I've tested it and it is working.

@jshwi thanks a lot! Good job! 🚀

@jshwi
Copy link
Owner

jshwi commented Jul 30, 2024

Awesome, no worries at all @LisPrzemyslaw ! Thanks for confirming 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants