Skip to content

Linter updates

Linter updates #4

Workflow file for this run

---
name: CI-linting
on:
pull_request:
branches: [main]
types: [opened, synchronize]
schedule:
- cron: "0 0 * * *"
jobs:
linting:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: install packages
run: |
pip install yamllint validate-pyproject
- name: pyproject.toml
run: |
validate-pyproject pyproject.toml
- name: yaml_config
run: |
# TODO - very large line length
echo 'rules:' > yaml_config.yaml
echo ' line-length:' >> yaml_config.yaml
echo ' max: 250' >> yaml_config.yaml
- name: Lint Code Base
uses: super-linter/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_YAML: true
YAML_CONFIG_FILE: yaml_config.yaml
YAML_ERROR_ON_WARNING: false
# VALIDATE_PYTHON_PYLINT: true
# PYTHON_PYLINT_CONFIG_FILE
VALIDATE_PYTHON_ISORT: true
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
VALIDATE_PYTHON_FLAKE8: true
VALIDATE_PYTHON_BLACK: true
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
VALIDATE_MARKDOWN: true
VALIDATE_DOCKERFILE_HADOLINT: true
LINTER_RULES_PATH: ./
# DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for non-ASCII characters
run: |
output=$(find . -type f \
\( -name "*.py" -o -name "*.rst" -o -name "*.yml" -o -name "*.toml" \) \
-exec perl -ne 'print if /[^[:ascii:]]/' {} \;)
if [ -n "$output" ]; then
echo "Non-ASCII characters found in documentation."
exit 1
fi