pawamoy / mkdocs-spellcheck

A spell checker plugin for MkDocs.
https://pawamoy.github.io/mkdocs-spellcheck/
ISC License
15 stars 3 forks source link

bug: `skip_files` is not OS-agnostic #21

Closed nfelt14 closed 2 months ago

nfelt14 commented 2 months ago

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
pawamoy commented 2 months ago

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

nfelt14 commented 2 months ago

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

pawamoy commented 2 months ago

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

nfelt14 commented 2 months ago

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

pawamoy commented 2 months ago

Ok great!