From b463fc3122c840ad5b8a033059c571ed6c097674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Skoglund?= Date: Tue, 21 Nov 2023 11:18:11 -0500 Subject: [PATCH 1/5] Update flake8 python version to 3.12 --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5796260..1d12c56 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,9 +17,9 @@ repos: hooks: - id: isort args: ["--profile", "black", "--filter-files"] - language_version: python3.11 + language_version: python3.12 - repo: https://github.com/pycqa/flake8 rev: '6.0.0' # pick a git hash / tag to point to hooks: - id: flake8 - language_version: python3.11 + language_version: python3.12 From 80247310e6d7bf9a873e6ed6ad19aa8b6acc7219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Skoglund?= Date: Tue, 21 Nov 2023 11:22:40 -0500 Subject: [PATCH 2/5] Ignore space after colon in string --- md2cf/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/md2cf/__main__.py b/md2cf/__main__.py index 7db41fb..7010593 100644 --- a/md2cf/__main__.py +++ b/md2cf/__main__.py @@ -350,6 +350,7 @@ def main(): attachment_path = attachment if not attachment_path.is_file(): + # noqa: E231 error_console.log( f"[bold red]:x: ERROR:[default] attachment {attachment_path} " f"for page {page.title} does not exist" From 2ded5d6419fa339776da8ad9bcc38272400f34b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Skoglund?= Date: Tue, 21 Nov 2023 11:23:34 -0500 Subject: [PATCH 3/5] Add ignores for flake8 inside strings --- md2cf/ignored_files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/md2cf/ignored_files.py b/md2cf/ignored_files.py index b1a08bb..e84311a 100644 --- a/md2cf/ignored_files.py +++ b/md2cf/ignored_files.py @@ -41,6 +41,7 @@ def _find_root_dir(start_path: Path): return p p = p.parent error_console.log( + # noqa: E231 f":warning-emoji: Directory {start_path} is not part of a git " f"repository: gitignore checking disabled." ) From ab019af9c762d881f780d0b67777223d06d39ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Skoglund?= Date: Tue, 21 Nov 2023 11:27:10 -0500 Subject: [PATCH 4/5] Upgrade flake8 in the hopes that it will fix the bug --- .pre-commit-config.yaml | 2 +- md2cf/__main__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d12c56..cb34a88 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: args: ["--profile", "black", "--filter-files"] language_version: python3.12 - repo: https://github.com/pycqa/flake8 - rev: '6.0.0' # pick a git hash / tag to point to + rev: '6.1.0' # pick a git hash / tag to point to hooks: - id: flake8 language_version: python3.12 diff --git a/md2cf/__main__.py b/md2cf/__main__.py index 7010593..48175fb 100644 --- a/md2cf/__main__.py +++ b/md2cf/__main__.py @@ -350,8 +350,8 @@ def main(): attachment_path = attachment if not attachment_path.is_file(): - # noqa: E231 error_console.log( + # noqa: E231 f"[bold red]:x: ERROR:[default] attachment {attachment_path} " f"for page {page.title} does not exist" ) From 44caa8b24b9f7761f6fe7f58728953e252368327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Skoglund?= Date: Tue, 21 Nov 2023 11:29:58 -0500 Subject: [PATCH 5/5] Remove unnecessary comments --- md2cf/__main__.py | 1 - md2cf/ignored_files.py | 1 - 2 files changed, 2 deletions(-) diff --git a/md2cf/__main__.py b/md2cf/__main__.py index 48175fb..7db41fb 100644 --- a/md2cf/__main__.py +++ b/md2cf/__main__.py @@ -351,7 +351,6 @@ def main(): if not attachment_path.is_file(): error_console.log( - # noqa: E231 f"[bold red]:x: ERROR:[default] attachment {attachment_path} " f"for page {page.title} does not exist" ) diff --git a/md2cf/ignored_files.py b/md2cf/ignored_files.py index e84311a..b1a08bb 100644 --- a/md2cf/ignored_files.py +++ b/md2cf/ignored_files.py @@ -41,7 +41,6 @@ def _find_root_dir(start_path: Path): return p p = p.parent error_console.log( - # noqa: E231 f":warning-emoji: Directory {start_path} is not part of a git " f"repository: gitignore checking disabled." )