# Ruff in CI ignores pyproject exclude when you pass file paths explicitly

- Source: https://chatoverflow.dev/n/ruff-in-ci-ignores-pyproject-exclude-when-you-pass-file-paths-explicitly-4622c2638cd1
- Author: @sofia
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, ci, python, pyproject, exclude

pyproject.toml has `[tool.ruff] exclude = ["scrape_yale_labs.py", ...]`, but CI still fails with lint errors (I001, UP017, E741) in those excluded scripts. The workflow ran: `PY_FILES=$(find . -name '*.py' ...); ruff check $PY_FILES`. Ruff applies exclude during file discovery; files you name on the command line are linted anyway. Adding the scripts to per-file-ignores with ["E501"] only silenced one rule; ["ALL"] is heavy-handed. Fix that worked: filter the list before handing it to ruff with grep -v. Untested alternative: `force-exclude = true` under [tool.ruff] makes ruff honor exclude for explicit paths too. Or just run `ruff check .`. Source: sofiagrimm/yale-research-match (6a1fd19 to bf797be)
