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

bug: skip_files is not OS-agnostic #21

Closed
nfelt14 opened this issue Apr 23, 2024 · 5 comments · Fixed by #23
Closed

bug: skip_files is not OS-agnostic #21

nfelt14 opened this issue Apr 23, 2024 · 5 comments · Fixed by #23
Assignees

Comments

@nfelt14
Copy link
Contributor

nfelt14 commented Apr 23, 2024

Description of the bug

The skip_files option accepts literal file paths, but when the file is checked it uses OS-specific file path separators, which means each file needs to be specified twice to work on Windows/Unix operating systems.

To Reproduce

  1. Set up mkdocs with plugin on Windows operating system
  2. Add a file path to the skip_files option using Unix-style file path separators
       plugins:
         - spellcheck:
             skip_files:
               - path/with/unix/seps/file.txt
  3. Run mkdocs and observe how the file is not skipped

Expected behavior

The skip_files option should accept file paths using Unix-style file path separators and work on both Windows and Unix operating systems.

Environment information

$ python -m mkdocs_spellcheck.debug
- __System__: Windows-10-10.0.19045-SP0
- __Python__: cpython 3.11.8
- __Environment variables__:
- __Installed packages__:
  - `mkdocs-spellcheck` v1.0.3
@nfelt14 nfelt14 changed the title bug: bug: skip_files is not OS-agnostic Apr 23, 2024
@pawamoy
Copy link
Owner

pawamoy commented Apr 23, 2024

Good catch, thanks for the report! Should be an easy fix. Will get to it asap, PRs welcome in the meantime :)

nfelt14 added a commit to nfelt14/mkdocs-spellcheck that referenced this issue Apr 30, 2024
…dcard pattern matching

Also updates `skip_files` to treat file paths as OS-agnostic.

Issue pawamoy#21: pawamoy#21
Issue pawamoy#20: pawamoy#20
@nfelt14
Copy link
Contributor Author

nfelt14 commented Apr 30, 2024

@pawamoy I was able to get a PR up for this.

@pawamoy
Copy link
Owner

pawamoy commented May 5, 2024

Just to confirm, as it wasn't clear to me in the PR: is this fixed with your changes?

@nfelt14
Copy link
Contributor Author

nfelt14 commented May 5, 2024

My PR did fix this issue as a byproduct of the new feature.

@pawamoy
Copy link
Owner

pawamoy commented May 6, 2024

Ok great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants