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

--style should work with unrecognised files #909

Merged
merged 2 commits into from Apr 8, 2024

Conversation

carmenbianca
Copy link
Member

@carmenbianca carmenbianca commented Feb 14, 2024

Fixes #902
Fixes #917

Copy link
Contributor

@lpechacek lpechacek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hit the bug as well and arrived at roughly the same solution. FWIW, I think that the fix is correct.

For the record, my fix

From 47a9de42353f680c9d62550c02f24fe17c5982e5 Mon Sep 17 00:00:00 2001
From: Libor Pechacek <lpechacek@gmx.com>
Date: Mon, 1 Apr 2024 12:13:29 +0200
Subject: [PATCH 1/2] Make the --style option work again

---
 src/reuse/_annotate.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/reuse/_annotate.py b/src/reuse/_annotate.py
index b867d62a2faf..07d892ad8bbf 100644
--- a/src/reuse/_annotate.py
+++ b/src/reuse/_annotate.py
@@ -492,7 +492,8 @@ def run(args: Namespace, project: Project, out: IO[str] = sys.stdout) -> int:
 
     paths = all_paths(args, project)
 
-    verify_paths_comment_style(args, paths)
+    if args.style is None:
+        verify_paths_comment_style(args, paths)
 
     if not args.force_dot_license:
         verify_write_access(paths, args.parser)
-- 
2.44.0

Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
@carmenbianca carmenbianca merged commit 3d2c59d into fsfe:main Apr 8, 2024
15 checks passed
@carmenbianca carmenbianca mentioned this pull request Apr 8, 2024
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