From 621d0ad138ec1b71117b335c850b58a20c00d1fd Mon Sep 17 00:00:00 2001 From: Marius Zwicker Date: Mon, 4 Dec 2023 06:59:11 +0100 Subject: [PATCH] Make suffix testing case insensitive --- Changelog.md | 1 + license_tools/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 99d10f8..f61fc49 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 ------ diff --git a/license_tools/__init__.py b/license_tools/__init__.py index ae51a08..df3723f 100644 --- a/license_tools/__init__.py +++ b/license_tools/__init__.py @@ -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):