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

ni-python-styleguide's --extend-exclude format is inconsistent with black #134

Open
bkeryan opened this issue Jun 28, 2023 · 1 comment
Open

Comments

@bkeryan
Copy link
Contributor

bkeryan commented Jun 28, 2023

Some of our projects attempt to exclude the same files in both tools.black and tools.ni-python-styleguide. However, the extend_exclude key has a different format for each tool: black uses a regex and ni-python-styleguide uses a comma-separated list of fnmatch patterns.

In nidaqmx-python, we tried to keep these in sync, but copying the ni-python-styleguide format to the tools.black section results in a regex that doesn't match anything.
https://github.com/ni/nidaqmx-python/blob/master/pyproject.toml#L82

@mshafer-NI
Copy link
Collaborator

mshafer-NI commented Jun 28, 2023

To add some more flavor,

because we have flake8-black in play, anyone running "black ." may have files get formatted that ni-python-styleguide would ignore if they don't configure black.

Workarounds:

  • provide extend_exclude to both tools, in seperate formats
  • only ever run ni-python-styleguide fix and NOT call black directly.

bkeryan added a commit to ni/nidaqmx-python that referenced this issue Jun 29, 2023
`black` and `ni-python-styleguide` have different formats for `extend_exclude`:
- `black` uses a single regex
- `ni-python-styleguide` uses a comma-separated list of `fnmatch` patterns

See ni/python-styleguide#134 for more info.

Signed-off-by: Brad Keryan <[email protected]>
bkeryan added a commit to ni/nidaqmx-python that referenced this issue Jun 30, 2023
`black` and `ni-python-styleguide` have different formats for `extend_exclude`:
- `black` uses a single regex
- `ni-python-styleguide` uses a comma-separated list of `fnmatch` patterns

See ni/python-styleguide#134 for more info.

Signed-off-by: Brad Keryan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants