-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
feature: Ability to skip files based on globs or regex #20
Comments
Hey @nfelt14, thanks for the request 🙂 I agree that it would be nice to be able to ignore files based on globs on regex. Would you like to submit a PR? If you want to go with globs, which I'd prefer, here's how I did it in another project: def _expand_inputs(self, inputs: list[str], page_uris: list[str]) -> list[str]:
expanded: list[str] = []
for input_file in inputs:
if "*" in input_file:
expanded.extend(fnmatch.filter(page_uris, input_file))
else:
expanded.append(input_file)
return expanded
def on_files(self, files: Files, *, config: MkDocsConfig) -> Files | None: # noqa: ARG002
for manpage in self.config.pages:
manpage["inputs"] = self._expand_inputs(manpage["inputs"], page_uris=list(files.src_uris.keys()))
return files This code should be updated to fit mkdocs-spellcheck configuration of course 🙂 The advantage of this approach is that we don't read the disk, and rather use the file objects collected by MkDocs, therefore supporting dynamically generated files that don't even exist in the docs folder. |
If I can find the time to work on it, I will let you know. |
…dcard pattern matching Also updates `skip_files` to treat file paths as OS-agnostic. Issue pawamoy#21: pawamoy#21 Issue pawamoy#20: pawamoy#20
@pawamoy I was able to get a PR up for this. |
@pawamoy, any idea when a new release with this feature will be available? |
Later today 👍 |
v1.1.0 released 🙂 |
Is your feature request related to a problem? Please describe.
I have a lot of auto-generated API documentation files that contain lots of words that get flagged as spelling errors, but really should be ignored.
Describe the solution you'd like
I would like to be able to specify a glob or regex to ignore groups of files when spellchecking.
Describe alternatives you've considered
The only workaround is to list each and every file in the
skip_files
option list, but I am dealing with 600+ files that may need to be ignored.The text was updated successfully, but these errors were encountered: