Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint Tiltfiles with ruff and fix findings #625

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dbast
Copy link
Contributor

@dbast dbast commented Dec 23, 2024

Enable linting Tiltfiles via ruff and fix findings. As Tilfiles/Starlark is a subset of Python, we need to disable some Ruff rules that don't apply (done in the pyproject.toml).

This finds unused variables, ambiguous named variables (l is hard to distinguish from 1 or L depending what IDE font is used), mixing of tab/spaces used for indentation, etc.

The commit of this PR can be potentially added to a .git-blame-ignore-revs after merge, see also https://github.blog/changelog/2022-03-24-ignore-commits-in-the-blame-view-beta/

@dbast dbast force-pushed the tiltfile-lint branch 2 times, most recently from a6d1e78 to 13f87ff Compare December 23, 2024 11:52
@dbast dbast marked this pull request as ready for review December 23, 2024 12:02
Comment on lines +18 to +19
files: ^.*Tiltfile|^.*\.py$
types_or: [text]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be updated to types_or: [python, starlark] (without further files definition) once this gets accepted pre-commit/identify#494 and released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant