Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Quality in CI #360

Merged
merged 4 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- master

jobs:
code-quality:
runs-on: ubuntu-latest
env:
SKIP: no-commit-to-branch # skips commit to main check
PRE_COMMIT_CONFIG: code_quality/.pre-commit-config.yaml
VENV: venv
VENV_ACTIVATE: venv/bin/activate

steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # V4.1.7
with:
token: ${{ github.token }}

- name: Cache pre-commit dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # V4.0.2
id: cache
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles(env.PRE_COMMIT_CONFIG) }}
restore-keys: |
${{ runner.os }}-pre-commit-

- name: Install Requirements
run: python3 -m pip install docstr-coverage==2.3.2 pre-commit==3.7.1

- name: Code Quality
run: |
pre-commit run --config ${{ env.PRE_COMMIT_CONFIG }} --all-files

- name: Docstring Coverage
run: |
mkdir -p docs/badges/ docstr
mv code_quality/.docstr.yaml . # --config option didn't work
docstr-coverage 2>&1 | tee docstr/docstring_coverage.txt
ls docs/badges
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

1 change: 1 addition & 0 deletions _TRANSLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ In Python files, you can mark a string for translation on the web frontend using
```python
# At the top of the file
import flask_babel

_ = flask_babel.gettext

# At use site, include a tagged comment which will be included for the
Expand Down
Loading