summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2022-03-21 17:48:20 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2022-03-23 19:57:20 +0100
commitbdeb7e5f0cdafab92efc3fe52b4d1e94ee3344e5 (patch)
tree7de793a1895346c5b47a9db7834bd04b100dfe2b
parent536087e448f9204ddbaea10a55ca5eab7d64de0d (diff)
downloadpylint-git-bdeb7e5f0cdafab92efc3fe52b4d1e94ee3344e5.tar.gz
Add a script to update the CONTRIBUTORS.txt
-rw-r--r--requirements_test.txt1
-rw-r--r--script/__init__.py3
-rw-r--r--script/bump_changelog.py4
-rw-r--r--script/copyright.txt3
-rw-r--r--script/create_contributor_list.py21
-rw-r--r--script/fix_documentation.py4
-rw-r--r--script/get_unused_message_id_category.py1
-rw-r--r--setup.cfg3
-rw-r--r--tbump.toml8
9 files changed, 48 insertions, 0 deletions
diff --git a/requirements_test.txt b/requirements_test.txt
index bcc6311fc..2e35f584d 100644
--- a/requirements_test.txt
+++ b/requirements_test.txt
@@ -4,6 +4,7 @@ coveralls~=3.3
coverage~=6.2
pre-commit~=2.17;python_full_version>="3.6.2"
tbump~=6.6.0
+contributors-txt>=0.7.3
pyenchant~=3.2
pytest-cov~=3.0
pytest-profiling~=1.7
diff --git a/script/__init__.py b/script/__init__.py
index e69de29bb..e8a8ff79f 100644
--- a/script/__init__.py
+++ b/script/__init__.py
@@ -0,0 +1,3 @@
+# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
diff --git a/script/bump_changelog.py b/script/bump_changelog.py
index 6e25719d4..f1edcdbb0 100644
--- a/script/bump_changelog.py
+++ b/script/bump_changelog.py
@@ -1,3 +1,7 @@
+# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
+
# ORIGINAL here: https://github.com/PyCQA/astroid/blob/main/script/bump_changelog.py
# DO NOT MODIFY DIRECTLY
diff --git a/script/copyright.txt b/script/copyright.txt
new file mode 100644
index 000000000..e8a8ff79f
--- /dev/null
+++ b/script/copyright.txt
@@ -0,0 +1,3 @@
+# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
diff --git a/script/create_contributor_list.py b/script/create_contributor_list.py
new file mode 100644
index 000000000..9b336a01b
--- /dev/null
+++ b/script/create_contributor_list.py
@@ -0,0 +1,21 @@
+# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
+
+from pathlib import Path
+
+from contributors_txt import create_contributors_txt
+
+BASE_DIRECTORY = Path(__file__).parent.parent
+ALIASES_FILE = BASE_DIRECTORY / "script/.contributors_aliases.json"
+DEFAULT_CONTRIBUTOR_PATH = BASE_DIRECTORY / "CONTRIBUTORS.txt"
+
+
+def main():
+ create_contributors_txt(
+ aliases_file=ALIASES_FILE, output=DEFAULT_CONTRIBUTOR_PATH, verbose=True
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/script/fix_documentation.py b/script/fix_documentation.py
index 0fc4e347e..24dd0097e 100644
--- a/script/fix_documentation.py
+++ b/script/fix_documentation.py
@@ -1,3 +1,7 @@
+# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
+
"""Small script to fix various issues with the documentation. Used by pre-commit."""
import argparse
import re
diff --git a/script/get_unused_message_id_category.py b/script/get_unused_message_id_category.py
index 95d7ac3e3..7bf1a1343 100644
--- a/script/get_unused_message_id_category.py
+++ b/script/get_unused_message_id_category.py
@@ -1,6 +1,7 @@
"""Small script to get a new unused message id category."""
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
from typing import List
diff --git a/setup.cfg b/setup.cfg
index 31de3b711..42b349e38 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -102,6 +102,9 @@ ignore_missing_imports = True
[mypy-tests.*]
ignore_missing_imports = True
+[mypy-contributors_txt]
+ignore_missing_imports = True
+
[mypy-coverage]
ignore_missing_imports = True
diff --git a/tbump.toml b/tbump.toml
index 0429cbd3a..6744a745e 100644
--- a/tbump.toml
+++ b/tbump.toml
@@ -33,6 +33,14 @@ name = "Upgrade and check doc"
cmd = "tox -e docs||echo 'Hack so this command does not fail'"
[[before_commit]]
+name = "Normalize the contributors-txt configuration"
+cmd = "contributors-txt-normalize-configuration -a script/.contributors_aliases.json -o script/.contributors_aliases.json"
+
+[[before_commit]]
+name = "Upgrade the contributors list"
+cmd = "python3 script/create_contributor_list.py"
+
+[[before_commit]]
name = "Upgrade copyrights"
cmd = "pip3 install copyrite;copyrite --contribution-threshold 1 --change-threshold 3 --backend-type git --aliases=.copyrite_aliases . --jobs=8"