Pre commit new UI#14836
Conversation
| - id: ui-lint-test | ||
| name: Lint and test React UI | ||
| language: system | ||
| entry: ./scripts/ci/pre_commit/pre_commit_ui_lint_test.sh |
There was a problem hiding this comment.
I believe using system hook and script is not needed (but I am not sure if it works with yarn)
pre-commit has a built-in language: node and it understand package.json. Not sure about yarn.lock though . But if we can make it works - it will even automatically rebuild the node environment for you and allow to run yarn commands.
You can some examples here:
https://github.com/Exocortex/pre-commit/blob/master/.pre-commit-hooks.yaml
Also I think you should select the files that the lint should run on - .js files basically. Pre-commit has the nice feature that it only runs the checks on files that are changed in your commit but also splits the checks to N parallell checks - as many as many processors you have. So for sure you need "files:" field to tell pre-commit which files it should run on and your command (either script or yarn command) should take those files as parameters.
For example when you only change a.js, b.js, c.js but not d.js and you have 2 CPUs precommit should run two commands in parallel:
yarn lint a.js b.js
yarn lint c.js
There was a problem hiding this comment.
Good call. Updated. I also made lint and test separate hooks.
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
This reverts commit e395fcd.
Add pre-commit hook to lint and test the new react UI.
Closes #14726
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.