Skip to content

Commit

Permalink
aboutcode-org#3659 Fix copyright detection normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
arshad-muhammad committed Oct 4, 2024
1 parent 585a166 commit 0d2ce3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cluecode/normalizer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import re

def normalize_copyright_symbols(text):
"""
Replace [C] or [c] with (C) to ensure proper copyright detection.
"""
# Replace [C] or [c] with (C)
text = re.sub(r'\[C\]', '(C)', text, flags=re.IGNORECASE)
return text

2 comments on commit 0d2ce3f

@pombredanne
Copy link

Choose a reason for hiding this comment

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

Great start, but add this to the develop branch now, rather than the detect-go-binary-packages
Also:

  1. start with a few unit tests (or use doctests)
  2. move that code to copyrights.py so it can be used there

@arshad-muhammad
Copy link
Owner Author

@arshad-muhammad arshad-muhammad commented on 0d2ce3f Oct 4, 2024

Choose a reason for hiding this comment

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

@pombredanne thanks.. Okay I'll add this to develop branch and do tests.

Please sign in to comment.