You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been staring at the docs that mention that one could lint INI-files here https://nitpick.readthedocs.io/en/latest/plugins.html#ini-files with a few hardcoded examples of such files. I tried applying it to .flake8 and .pylintrc and it worked. But when I did the same for .isort.cfg, nitpick just spit out this:
nitpick-style.toml:1: NIP001 has an incorrect style. Invalid config:".isort.cfg".settings: Unknown configuration. See https://nitpick.rtfd.io/en/latest/plugins.html#text-files.
I wondered why it'd identify this file as just a text file when it's clearly parseable with cfgparser. Grepping for hardcoded file names recognized as INI didn't help but staring at https://github.com/andreoliwa/nitpick/blob/develop/src/nitpick/plugins/ini.py did. I was lucky to notice identify in the var names even though it wasn't directly imported in that module. This is because I happen to know what that project is.
While that patch will address the immediate problem, I felt like this issue needed to be filed anyway because this situation reveals problems in nitpick itself too.
I think that there are 2 possible action items (non-exclusive):
mention that identify is used in the docs and suggest the users to submit PRs there to add new file classifications
implement a config setting in nitpick itself allowing the end-users to specify that some specific file is of a specific (known to them) type and should be linted with a certain plugin
I hope this story provides all the necessary details to be actionable :)
The text was updated successfully, but these errors were encountered:
implement a config setting in nitpick itself allowing the end-users to specify that some specific file is of a specific (known to them) type and should be linted with a certain plugin
So I'd say that this action item would be important to implement. Plus, since the identify upstream isn't always open to accepting improvements, sending the users there would be rather useless.
I've been staring at the docs that mention that one could lint INI-files here https://nitpick.readthedocs.io/en/latest/plugins.html#ini-files with a few hardcoded examples of such files. I tried applying it to
.flake8
and.pylintrc
and it worked. But when I did the same for.isort.cfg
,nitpick
just spit out this:I wondered why it'd identify this file as just a text file when it's clearly parseable with cfgparser. Grepping for hardcoded file names recognized as INI didn't help but staring at https://github.com/andreoliwa/nitpick/blob/develop/src/nitpick/plugins/ini.py did. I was lucky to notice
identify
in the var names even though it wasn't directly imported in that module. This is because I happen to know what that project is.I quickly confirmed my suspicion with
So I've gone ahead and submitted this PR upstream at pre-commit/identify#323.
While that patch will address the immediate problem, I felt like this issue needed to be filed anyway because this situation reveals problems in
nitpick
itself too.I think that there are 2 possible action items (non-exclusive):
identify
is used in the docs and suggest the users to submit PRs there to add new file classificationsnitpick
itself allowing the end-users to specify that some specific file is of a specific (known to them) type and should be linted with a certain pluginI hope this story provides all the necessary details to be actionable :)
The text was updated successfully, but these errors were encountered: