From 2b53ab9b4a52122d1deccb811edaea8846c90b21 Mon Sep 17 00:00:00 2001 From: Franco Masotti Date: Sun, 26 Jun 2022 17:55:46 +0200 Subject: [PATCH] - Updated hooks. - Minor fixes. --- .pre-commit-config.yaml | 6 +++--- scripts/add_submodules_gitea.py | 14 +++++++++----- stats/repo_stats.csv | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20d8568..bfcdd3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ files: '(README.md|configuration.yaml|Makefile|scripts/.*)' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -16,7 +16,7 @@ repos: - id: debug-statements - repo: https://codeberg.org/frnmst/md-toc - rev: '8.1.0' # or a specific git tag from md-toc + rev: '8.1.4' # or a specific git tag from md-toc hooks: - id: md-toc args: [-p, 'github', '-l6'] # CLI options @@ -33,7 +33,7 @@ repos: - id: isort - repo: https://github.com/PyCQA/bandit - rev: '1.7.1' # Use the sha / tag you want to point at + rev: '1.7.4' # Use the sha / tag you want to point at hooks: - id: bandit args: ['--skip', 'B404,B506,B410,B603', '--level', 'LOW'] diff --git a/scripts/add_submodules_gitea.py b/scripts/add_submodules_gitea.py index 2c40e37..20ea796 100755 --- a/scripts/add_submodules_gitea.py +++ b/scripts/add_submodules_gitea.py @@ -18,21 +18,24 @@ # # You should have received a copy of the GNU General Public License # along with python-packages-source. If not, see . +r"""Add git submodules to the repository.""" -import shlex import contextlib +import os +import shlex + import fpyutils import gitea -import os -SUBMODULES_DIRECTORY='../submodules' +SUBMODULES_DIRECTORY = '../submodules' + # See # https://stackoverflow.com/a/13847807 # CC BY-SA 4.0 # spiralman, bryant1410 @contextlib.contextmanager -def pushd(new_dir): +def _pushd(new_dir): previous_dir = os.getcwd() os.chdir(new_dir) try: @@ -43,10 +46,11 @@ def pushd(new_dir): if __name__ == '__main__': def main(): + r"""Main.""" results = gitea.get_org_repos() # Get the original URLs of mirrors only. - with pushd(SUBMODULES_DIRECTORY): + with _pushd(SUBMODULES_DIRECTORY): for r in results: for rr in r: if rr['mirror'] and not rr['empty']: diff --git a/stats/repo_stats.csv b/stats/repo_stats.csv index 8ec3479..4562cc8 100644 --- a/stats/repo_stats.csv +++ b/stats/repo_stats.csv @@ -39,3 +39,4 @@ 543,503,2022-06-05 22:08:14 +0000 557,517,2022-06-12 22:13:36 +0000 557,517,2022-06-19 22:13:25 +0000 +557,517,2022-06-26 15:51:39 +0000