Skip to content

Commit

Permalink
merge: Rewrite the link fixer script (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger authored Nov 18, 2024
2 parents 6e192f2 + df9df36 commit cd25e42
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 174 deletions.
56 changes: 9 additions & 47 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ name: Build
on:
push:
branches: ["*"]
pull_request: [master]
tags: ["v*.*.*"]

jobs:
Expand All @@ -18,60 +17,23 @@ jobs:
matrix:
os: [ubuntu-latest]
python_version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
include:
- os: windows-latest
python_version: "3.9"
python_version: "3.10"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{matrix.python_version}}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
cache: pip
cache-dependency-path: pyproject.toml
python-version: ${{matrix.python_version}}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}}
restore-keys: |
${{runner.os}}-pip-
${{runner.os}}-
- name: Upgrade Pip
run: |-
python -m pip install -U pip
run: python -m pip install -U pip
- name: Install test dependencies
run: |-
python -m pip install '.[test]'
run: python -m pip install '.[test]'
- name: Run unit tests
run: |-
python -m pytest --cov-report=term --cov=capella_git_hooks --rootdir=.
# publish:
# name: Publish artifacts
# runs-on: ubuntu-latest
# needs: test
# steps:
# - uses: actions/checkout@v2
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: "3.9"
# - name: Install dependencies
# run: |-
# python -m pip install -U pip
# python -m pip install build twine
# - name: Build packages
# run: |-
# python -m build
# - name: Verify packages
# run: |-
# python -m twine check dist/*
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Artifacts
# path: 'dist/*'
# - name: Publish to PyPI (release only)
# if: startsWith(github.ref, 'refs/tags/v')
# run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive dist/*
run: python -m pytest --cov-report=term --cov=capella_git_hooks --rootdir=.
9 changes: 5 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: pip
python-version: "3.10"
- name: Upgrade pip
run: |
python -m pip install -U pip
Expand All @@ -32,7 +33,7 @@ jobs:
run: |
make -C docs html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: pip
python-version: "3.10"
- name: Upgrade pip
run: |-
python -m pip install -U pip
Expand All @@ -27,10 +28,11 @@ jobs:
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: pip
python-version: "3.10"
- name: Upgrade pip
run: |-
python -m pip install -U pip
Expand Down
20 changes: 11 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# SPDX-License-Identifier: CC0-1.0

default_install_hook_types: [commit-msg, pre-commit]
default_stages: [commit, merge-commit]
default_stages: [pre-commit, pre-merge-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -26,15 +26,15 @@ repos:
- id: fix-byte-order-marker
- id: trailing-whitespace
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38
hooks:
- id: docformatter
additional_dependencies:
Expand All @@ -47,11 +47,13 @@ repos:
additional_dependencies:
- pydocstyle[toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
- capellambse==0.6.10
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
rev: v1.5.5
hooks:
- id: insert-license
name: Insert license headers (shell-style comments)
Expand Down Expand Up @@ -94,10 +96,10 @@ repos:
- --comment-style
- '..| |'
- repo: https://github.com/fsfe/reuse-tool
rev: v2.1.0
rev: v5.0.2
hooks:
- id: reuse
- repo: https://github.com/qoomon/git-conventional-commits
rev: v2.6.5
rev: v2.6.7
hooks:
- id: conventional-commits
4 changes: 2 additions & 2 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- id: fix-links
- id: fix-capella-fragment-links
name: fix links after breaking merge
description: After a breaking merge by the merge tool, this script fixes links starting with index:/.
entry: fix-links
entry: fix-capella-fragment-links
language: python
always_run: true
stages: [post-commit]
Loading

0 comments on commit cd25e42

Please sign in to comment.