From 708def1a5607bd6ebc619ae11ad30c0ffc000e90 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Tue, 5 Sep 2023 12:10:13 -0400 Subject: [PATCH] fix absolute paths not considered for ignore-path-errors option (fixes #147) --- .gitignore | 4 ++++ src/doc8/main.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 3dc85bd..aa8e74f 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,7 @@ coverage.xml # Sphinx documentation doc/build/ src/doc8/_version.py + +# IDE caches +.idea/ +.vscode/ diff --git a/src/doc8/main.py b/src/doc8/main.py index c061cc6..9206470 100644 --- a/src/doc8/main.py +++ b/src/doc8/main.py @@ -230,6 +230,10 @@ def validate(cfg, files, result=None): error_counts = {} ignoreables = frozenset(cfg.get("ignore", [])) ignore_targeted = cfg.get("ignore_path_errors", {}) + ignore_targeted = { + os.path.abspath(file_path): ignore_codes + for file_path, ignore_codes in ignore_targeted.items() + } while files: f = files.popleft() if cfg.get("verbose"):