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

ignore-path-errors does not like relative paths #162

Open
sarnold opened this issue Aug 30, 2024 · 2 comments
Open

ignore-path-errors does not like relative paths #162

sarnold opened this issue Aug 30, 2024 · 2 comments

Comments

@sarnold
Copy link

sarnold commented Aug 30, 2024

Howdy, I have a lot of project repos using pre-commit which usually means using doc8 for readme files, etc. Normally it works fine, however, using it with a more complex document structure using include files, it fails to selectively ignore specific errors.

Currently I'm using global ignore for D000 but that's not what I want, and I can't seem to make ignore-path-errors work at all, with either relative or absolute paths. Things I tried:

  • moved config from pyproject.toml to tox.ini file
  • made sure pre-commit config only uses --config arg
  • set pre-commit version to latest doc8 hash on master

In this case, the doc repo belongs to a customer so I can't share it, but the doc tree was derived from this template which probably doesn't help much beyond "this is the basic project workflow".

AFAICT there is not any explicit support for link checking across document files? (that is a question) So the alternative for me is a working ignore-path-errors feature. Thanks!

@fmigneault
Copy link
Contributor

I pushed this update fixing ignore-path-errors some time ago

I'm also using many cross-file reference in my projects, and doc8 does not complain in my case.
However, I'm using setup.cfg.

I think the error must be caused by pyproject.toml parsing.
There are similar issues about it failing to parse #145.

@priteau
Copy link

priteau commented Nov 18, 2024

I have issues using ignore-path-errors with relative path too, which appear to be caused by #148.

Inside the validate() function, doc8 fails to match the file because ignore_targeted is an absolute path and f.filename is a relative path.

openstack-mirroring pushed a commit to openstack/kolla-ansible that referenced this issue Jan 22, 2025
When a path is broken into two separate lines, the generated HTML
includes an incorrect space character in the middle of the path.

We need to ignore doc8 linting on this file as this change breaks the
max line length check. I tried using ``ignore-path-errors`` to exclude
only D001 for this file, but doc8 does not like a relative path for this
option [1].

[1] PyCQA/doc8#162

Change-Id: I1cf0b7a6b7506a68876bce2de5080718280a47be
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Jan 22, 2025
* Update kolla-ansible from branch 'master'
  to c709c2c43ec6a29fd52e984586255ab98402bd37
  - Merge "docs: minor fixes to external Ceph guide"
  - docs: minor fixes to external Ceph guide
    
    When a path is broken into two separate lines, the generated HTML
    includes an incorrect space character in the middle of the path.
    
    We need to ignore doc8 linting on this file as this change breaks the
    max line length check. I tried using ``ignore-path-errors`` to exclude
    only D001 for this file, but doc8 does not like a relative path for this
    option [1].
    
    [1] PyCQA/doc8#162
    
    Change-Id: I1cf0b7a6b7506a68876bce2de5080718280a47be
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

No branches or pull requests

3 participants