lint: ignore files in .gitignore for black
Metadata
Current evaluation
Merged changes to update Black linting configuration, replacing exclude with extend-exclude to properly respect .gitignore files. Exclusions for prime/ and stage/ are now limited to the project root. Coverage unchanged.
Suggested action: —
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
1. Replace `exclude` with `extend-exclude` for `black`:
From [black docs](https://black.readthedocs.io/en/stable/usage_and_configuration/file_collection_and_discovery.html#gitignore):
> .gitignore
>
> If --exclude is not set, Black will automatically ignore files and directories in .gitignore file(s), if present.
>
> If you want Black to continue using .gitignore while also configuring the exclusion rules, please use --extend-exclude.
2. Only ignore `prime/` and `stage/` in the root of the project. This is already done for `parts/`. All 3 directories come from building snapcraft in destructive mode)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged changes to update Black linting configuration, replacing exclude with extend-exclude to properly respect .gitignore files. Exclusions for prime/ and stage/ are now limited to the project root. Coverage unchanged. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Updated Black configuration to use extend-exclude instead of exclude, preserving .gitignore rules while adding root prime/ and stage/ exclusions. Code coverage remains unchanged. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Replaced black exclude with extend-exclude to properly respect .gitignore rules while maintaining custom exclusions. Added root prime/ and stage/ directories to ignored paths. Codecov confirms no coverage impact. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3865 lint: lint legacy code with black | snapcraft | merged | Merged updates to the test-black lint command to include legacy code, aligning it with autoformat-black. Approved by a maintainer, passed CI checks, and merged without affecting code coverage. | |
| #3650 lint: apply autoformat-black to source files | snapcraft | merged | Merged following maintainer approval and passing CI. The update modifies the lint configuration to apply autoformat-black exclusively to source files, aligning it with test-black behavior. | |
| #3853 lint: lint legacy code with black | snapcraft | merged | Merged following reviewer approval and passing CI. Applied Black formatting to legacy code across 12 files, resulting in 84 additions and 37 deletions. Code coverage remained stable at 88.16%. |