Skip to content

Added include_paths option to whitelist files & paths#217

Draft
niekdomi wants to merge 4 commits intoblopker:mainfrom
niekdomi:include_path
Draft

Added include_paths option to whitelist files & paths#217
niekdomi wants to merge 4 commits intoblopker:mainfrom
niekdomi:include_path

Conversation

@niekdomi
Copy link
Contributor

@niekdomi niekdomi commented Feb 25, 2026

This option was quite convenient when developing a cli for codebook and i think its a nice addition to the ignore_paths. E.g., if only .rs files should be linted, I think it's better to use the include_paths rather than ignoring everything with ignore_paths.

@niekdomi niekdomi changed the title Added include_paths option to white list files & paths Added include_paths option to whitelist files & paths Feb 25, 2026
@blopker
Copy link
Owner

blopker commented Feb 25, 2026

Thanks for this. Can you describe in more detail how include_paths and ignore_paths should interact with each other? Maybe the config should be invalid if both are included?

@niekdomi
Copy link
Contributor Author

The idea is basically:

  • include_paths: whitelist, only list files, filetypes, directories that should be linted
  • ignore_paths: blacklist, files etc. that should not be linted.

Let's say you only want codespell to only lint rust files, instead of adding every other file etc. to the ignore_paths, the include_paths can be used.

They are complementary, though ignore_paths has higher precedence. So e.g.,

include_paths = [
    "**/*.yaml",
]
ignore_paths = [
    "**/*.yaml",
]

would lint nothing.

Should I add some test cases to "demonstrate" the expected behavior?

@niekdomi niekdomi marked this pull request as draft February 25, 2026 19:39
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

Successfully merging this pull request may close these issues.

2 participants