make ruff hook more general #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: 3.12 | |
channels: conda-forge | |
activate-environment: lcls-tools-dev | |
- name: Install lcls-tools | |
shell: bash -l {0} | |
run: | | |
pip install -e . | |
- name: Install pre-commit | |
shell: bash -l {0} | |
run: conda install pre-commit | |
- name: List Python package versions | |
shell: bash -l {0} | |
run: conda list | |
- name: Switch to a temporary branch | |
shell: bash -l {0} | |
run: | | |
git checkout -b _ci_branch_ | |
- name: Run pre-commit on all files | |
shell: bash -l {0} | |
env: | |
RUFF_OUTPUT_FORMAT: github | |
run: | | |
pre-commit run \ | |
--show-diff-on-failure \ | |
--color=always \ | |
--all-files |