Skip to content

Sensitivity name to sensitivearea model #4306

Sensitivity name to sensitivearea model

Sensitivity name to sensitivearea model #4306

Workflow file for this run

name: Linting
on:
workflow_dispatch:
pull_request:
paths:
- 'geotrek/**' # if geotrek code change
- '.github/workflows/lint.yml' # if lint workflow change
- 'requirements-dev.txt' # if requirements-dev.txt change
- 'ruff.toml' # if lint tools configuration change
jobs:
migrations:
name: Checking SRID in migrations files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
test $(ls geotrek/*/migrations/*.py | xargs grep -l srid | xargs grep -L SRID | wc -l) -eq 0
quality:
name: Checking lint rules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
version: "latest"
python-version: "3.10"
enable-cache: true
cache-suffix: "ruff"
activate-environment: true
- name: Install dependencies
run: |
uv pip install -c requirements-dev.txt ruff
- name: Check linting
run: |
ruff check geotrek
- name: Check format
run: |
ruff format --check geotrek
translations:
name: Checking translations files are up-to-date
permissions:
contents: write
actions: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
if: github.event.pull_request.head.repo.full_name != github.repository
with:
ref: ${{ github.head_ref }}
- uses: actions/checkout@v6
if: github.event.pull_request.head.repo.full_name == github.repository
with:
token: ${{ secrets.PAT }}
ref: ${{ github.head_ref }}
- name: Build environment
run: |
make build
cp .env.dist .env
sudo sed -i 's/UID=1000/UID=1001/' .env
sudo sed -i 's/GID=1000/GID=1001/' .env
cat .env
mkdir var && chmod 777 var
- name: Check translations
run: |
make messages
- uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
**/*.po
- name: Verify translation files changed
if: steps.verify-changed-files.outputs.files_changed == 'true'
env:
CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}
run: |
# search 'fuzzy' keywords in added lines (starting with '+' but not '+++')
git --no-pager diff --unified=0 -- '*.po' || true
if git --no-pager diff --unified=0 -- '*.po' | grep '+fuzzy' -n >/dev/null; then
git --no-pager diff --unified=0 -- '*.po' | grep '+fuzzy' -n
echo "::error:'fuzzy' keyword found in lines added to .po files"
#core.setFailed('You have suggested translations in your po files. Please fix them then run make messages')
fi
echo "No fuzzy translations. continue..."
- name: Commit translation file changed
uses: stefanzweifel/git-auto-commit-action@v7
if: steps.verify-changed-files.outputs.files_changed == 'true'
with:
# Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes"
commit_message: "Fix translation files"