Browse Source

- Updated hooks.

- Minor fixes.
master
Franco Masotti 2 months ago
parent
commit
2b53ab9b4a
Signed by: frnmst
GPG Key ID: 24116ED85666780A
  1. 6
      .pre-commit-config.yaml
  2. 14
      scripts/add_submodules_gitea.py
  3. 1
      stats/repo_stats.csv

6
.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']

14
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 <http://www.gnu.org/licenses/>.
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']:

1
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

1 21 21 2021-10-07 00:00:00 +0000
39 543 503 2022-06-05 22:08:14 +0000
40 557 517 2022-06-12 22:13:36 +0000
41 557 517 2022-06-19 22:13:25 +0000
42 557 517 2022-06-26 15:51:39 +0000
Loading…
Cancel
Save