Skip to content

Commit

Permalink
Make suffix testing case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
emzeat committed Dec 4, 2023
1 parent dccd15d commit 621d0ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ _WIP_
* Add support for dash style comments to support lua files
* Predefine comment style for rust rst files
* Predefine comment style for toml files
* Make detection of comment style based on suffix case insensitive

v2.6.2
------
Expand Down
2 changes: 1 addition & 1 deletion license_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def from_suffix(cls, ext):
suffix_overrides = getattr(cls, '__suffix_overrides', None)
if suffix_overrides and ext in suffix_overrides: # pylint: disable=unsupported-membership-test
return Style[suffix_overrides[ext]] # pylint: disable=unsubscriptable-object
return mapping.get(ext, Style.UNKNOWN)
return mapping.get(ext, None) or mapping.get(ext.lower(), Style.UNKNOWN)

@staticmethod
def from_name(name):
Expand Down

0 comments on commit 621d0ad

Please sign in to comment.