feat: add lint and fix commands to the Makefile#10
Conversation
a64d6b9 to
d66e550
Compare
d66e550 to
20ce2cd
Compare
|
@OmeGak friendly ping. |
056b04a to
3b892f0
Compare
3b892f0 to
bd7c067
Compare
Ensures ruff, python, isort and other venv binaries are available directly, which is needed by indico's pre-commit hook.
OmeGak
left a comment
There was a problem hiding this comment.
I'm really not sure that this repository should have Makefile targets for the many different actions that we may want to run in Indico core or any of the plugins.
I have made my arguments in the PR from @duartegalvao that adds pylint to the repo (https://github.com/unconventionaldotdev/indicorp/pull/11/changes#r2782634229).
Each plugin directory is its own standalone project with its own architecture and QA decisions. This Makefile target breaks that isolation in ways that I'm not sure we should. If we did, then, why not also adding a target for building wheels, linting, another one for DB schema migrations, etc.?
I'm checking with Adrian if we can add a Makefile in Indico core. If we had it, the workflow would be:
cd indico
make lintWhich I think is very reasonable.
| # Make virtualenv binaries (ruff, python, isort, etc.) available on PATH | ||
| PATH_add .venv/bin |
There was a problem hiding this comment.
Rather than mangling the PATH, I would prefer that we rely on uv run.
There was a problem hiding this comment.
Then you have to run uv run git commit, because pre-commit hooks are triggered. I do not recommend that.
There was a problem hiding this comment.
The pre-commit hook assumes that the virtualenv is active.
If so, fine for me. But still, until that's done it doesn't hurt to have our own and then remove it. Not a string opinion at all either. |
|
@ThiefMaster agreed with having a .PHONY: lint
lint: lint-py lint-js lint-locales lint-headers
.PHONY: lint-py
lint-py: lint-py-isort lint-py-ruff lint-py-backrefs
.PHONY: lint-py-isort
lint-py-isort:
isort --check-only
.PHONY: lint-py-ruff
lint-py-ruff:
ruff check --output-format=concise .
.PHONY: lint-py-backrefs
lint-py-backrefs:
bin/maintenance/update_backrefs.py --ci
.PHONY: lint-js
lint-js:
...
.PHONY: lint-locales
lint-locales:
bin/maintenance/update_moment_locales.py --ci
.PHONY: lint-icons
lint-icons:
bin/maintenance/generate_icons.py --ci
.PHONY: lint-headers
lint-headers:
unbehead --check |
Summary
Add
make lintandmake fixcommands that emulate the CI checks indico core follows, scoped to only changed files in the indico submodule. Covers Python (isort, unbehead, ruff) and JS/CSS (biome, eslint, tsc, stylelint) tooling.Also adds the virtualenv to PATH via direnv so that indico's pre-commit hook can find the required binaries (ruff, python, isort).