diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 94db572..85954ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,6 +88,11 @@ repos: rev: '36d4912df1f0bd2ed8cc535b57c5ba3b09ce3d46' # frozen: v0.35.0 hooks: - id: nitpick + - repo: "https://github.com/TotallyNotRobots/check-spdx-header" + rev: '2a52cf804e6dedd045e765185382d4f916ae2f3f' # frozen: 0.1.0a2 + hooks: + - id: fix-spdx-header + minimum_pre_commit_version: 2.18.0 default_install_hook_types: - pre-commit diff --git a/LICENSE b/LICENSE.txt similarity index 93% rename from LICENSE rename to LICENSE.txt index f20bc88..7039882 100644 --- a/LICENSE +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 linuxdaemon +Copyright (c) 2018-present linuxdaemon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/polymatch/__init__.py b/polymatch/__init__.py index 3d1de95..f598532 100644 --- a/polymatch/__init__.py +++ b/polymatch/__init__.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Polymorphic pattern matchers.""" from polymatch._version import ( diff --git a/polymatch/base.py b/polymatch/base.py index 34ee891..278329d 100644 --- a/polymatch/base.py +++ b/polymatch/base.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Base matcher classes. Matchers should implement `PolymorphicMatcher`. diff --git a/polymatch/error.py b/polymatch/error.py index 3303099..085513a 100644 --- a/polymatch/error.py +++ b/polymatch/error.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Exceptions raised by the library.""" from typing import TYPE_CHECKING, AnyStr, Type diff --git a/polymatch/matchers/__init__.py b/polymatch/matchers/__init__.py index dadfe10..aa00502 100644 --- a/polymatch/matchers/__init__.py +++ b/polymatch/matchers/__init__.py @@ -1 +1,5 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Core matcher implementations.""" diff --git a/polymatch/matchers/glob.py b/polymatch/matchers/glob.py index 775eb9a..fd7398e 100644 --- a/polymatch/matchers/glob.py +++ b/polymatch/matchers/glob.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Glob pattern matcher.""" from fnmatch import translate diff --git a/polymatch/matchers/regex.py b/polymatch/matchers/regex.py index 461210e..49e89a7 100644 --- a/polymatch/matchers/regex.py +++ b/polymatch/matchers/regex.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Regex pattern matcher.""" from typing import AnyStr diff --git a/polymatch/matchers/standard.py b/polymatch/matchers/standard.py index 3234185..3eee4c6 100644 --- a/polymatch/matchers/standard.py +++ b/polymatch/matchers/standard.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Basic string matchers (exact and contains).""" from typing import AnyStr diff --git a/polymatch/registry.py b/polymatch/registry.py index ad46d51..be324a5 100644 --- a/polymatch/registry.py +++ b/polymatch/registry.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Pattern matcher registry. This also implements parsing the pattern from a simple string e.g.: diff --git a/pyproject.toml b/pyproject.toml index 5611e23..8c2cd11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -208,3 +208,6 @@ major_version_zero = true [tool.nitpick] style = ["gh://TotallyNotRobots/nitpick/lib-style.toml"] + +[tool.check-spdx-header] +headers = ["2018-present linuxdaemon "] diff --git a/tests/__init__.py b/tests/__init__.py index 532b006..ad3c5d9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1,5 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Library tests.""" diff --git a/tests/base_test.py b/tests/base_test.py index 38b61c2..a2a827a 100644 --- a/tests/base_test.py +++ b/tests/base_test.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Test base patterns.""" import pytest diff --git a/tests/test_glob.py b/tests/test_glob.py index 239ab63..6ce1425 100644 --- a/tests/test_glob.py +++ b/tests/test_glob.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Test glob matcher.""" import pytest diff --git a/tests/test_pickling.py b/tests/test_pickling.py index ce1b5dd..31c2e01 100644 --- a/tests/test_pickling.py +++ b/tests/test_pickling.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Test pickling the pattern objects.""" import itertools diff --git a/tests/test_regex.py b/tests/test_regex.py index fbd28b5..9c7011d 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Test regex matcher.""" import pytest diff --git a/tests/test_registry.py b/tests/test_registry.py index cea23be..91856f9 100644 --- a/tests/test_registry.py +++ b/tests/test_registry.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Test the pattern registry.""" import pytest diff --git a/tests/test_standard.py b/tests/test_standard.py index 4529767..86bb151 100644 --- a/tests/test_standard.py +++ b/tests/test_standard.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2018-present linuxdaemon +# +# SPDX-License-Identifier: MIT + """Test standard matchers.""" import pytest