Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Aug 17, 2025

The pre-commit is a fantastic tool, and we heavily used it for years, but generally the tool stagnated and is not showing a sign of adapting to our needs. For years we tried to convince pre-commit maintainers that things like autocomplete are necessary - but it met with pretty much resistance (if not hostility) from the maintainer. Also there was no chance for them to accept expectations of bigger projects like ours, where we have a huge monorepo and not only multiple needs but also different parts of the repo needing different language support (golang, typescript soon) - and apparenty the maintainer of pre-commit does not think monorepo is a good thing at all. Similarly - they did not recognize the raise of uv and the only way to use uv with pre-commit is to patch it by installing pre-comit-uv that essentialy patches pre-commit with uv support. This is not really sustainable and the tool lags behind many of our needs.

Luckily - we have new project in town - prek - which rewrites pre-commit that is 100% compatible (now), 10x faster (because rust), uses uv natively, supports auto-complete already and they have very friendly maintainer who is not only supporting us but also very happily works on improving prek to close all the gaps, and plans to implement (with our support of course and cooperation) monorepo support - that will allow us to modularise our pre-commits.

This PR switches our pre-commit support to use prek exclusively:

  • breeze static checks command is completely removed
  • custom auto-complete code in breeze as well
  • instructions are updated to setup prek instead of precommit
  • CI is updated to run prek instead of pre-commmit
  • documentation for static checks is reviewed and new features that prek enables are added

(cherry picked from commit 3442d81)


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@potiuk
Copy link
Member Author

potiuk commented Aug 17, 2025

@jscheffl -> Was not that bad. I had to sync breeze with latest main (not diffocult) and bring back a few Python 3.9 construncts in that code, but other than that, it was rather painless. Let's see if the CI agrees as well.

@potiuk potiuk force-pushed the backport-3442d81-v3-0-test branch from 4035854 to a80f403 Compare August 17, 2025 12:25
@potiuk
Copy link
Member Author

potiuk commented Aug 17, 2025

Few breeze unit tests, but should be fixed now.

Copy link
Collaborator

@aritra24 aritra24 left a comment

Choose a reason for hiding this comment

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

Mostly nits, can be merged other than them

The pre-commit is a fantastic tool, and we heavily used it for years,
but generally the tool stagnated and is not showing a sign of adapting
to our needs. For years we tried to convince pre-commit maintainers that
things like autocomplete are necessary - but it met with pretty much
resistance (if not hostility) from the maintainer. Also there was no
chance for them to accept expectations of bigger projects like ours,
where we have a huge monorepo and not only multiple needs but also
different parts of the repo needing different language support (golang,
typescript soon) - and apparenty the maintainer of pre-commit does not
think monorepo is a good thing at all. Similarly - they did not recognize
the raise of `uv` and the only way to use `uv` with pre-commit is to patch
it by installing `pre-comit-uv` that essentialy patches pre-commit with
uv support. This is not really sustainable and the tool lags behind many
of our needs.

Luckily - we have new project in town - prek - which rewrites pre-commit
that is 100% compatible (now), 10x faster (because rust), uses `uv`
natively, supports auto-complete already and they have very friendly
maintainer who is not only supporting us but also very happily works
on improving `prek` to close all the gaps, and plans to implement (with
our support of course and cooperation) monorepo support - that will
allow us to modularise our pre-commits.

This PR switches our pre-commit support to use prek exclusively:

* breeze static checks command is completely removed
* custom auto-complete code in breeze as well
* instructions are updated to setup prek instead of precommit
* CI is updated to run prek instead of pre-commmit
* documentation for static checks is reviewed and new features that
  prek enables are added

(cherry picked from commit 3442d81)
@potiuk potiuk force-pushed the backport-3442d81-v3-0-test branch from a80f403 to 4c99ecc Compare August 17, 2025 12:42
@potiuk
Copy link
Member Author

potiuk commented Aug 17, 2025

Thanks @aritra24 ! addressed all.

Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

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

Did not find/see another typo, LGTM!

@potiuk potiuk merged commit 16fc308 into apache:v3-0-test Aug 17, 2025
129 checks passed
@potiuk potiuk deleted the backport-3442d81-v3-0-test branch August 17, 2025 14:00
kaxil pushed a commit that referenced this pull request Aug 18, 2025
The pre-commit is a fantastic tool, and we heavily used it for years,
but generally the tool stagnated and is not showing a sign of adapting
to our needs. For years we tried to convince pre-commit maintainers that
things like autocomplete are necessary - but it met with pretty much
resistance (if not hostility) from the maintainer. Also there was no
chance for them to accept expectations of bigger projects like ours,
where we have a huge monorepo and not only multiple needs but also
different parts of the repo needing different language support (golang,
typescript soon) - and apparenty the maintainer of pre-commit does not
think monorepo is a good thing at all. Similarly - they did not recognize
the raise of `uv` and the only way to use `uv` with pre-commit is to patch
it by installing `pre-comit-uv` that essentialy patches pre-commit with
uv support. This is not really sustainable and the tool lags behind many
of our needs.

Luckily - we have new project in town - prek - which rewrites pre-commit
that is 100% compatible (now), 10x faster (because rust), uses `uv`
natively, supports auto-complete already and they have very friendly
maintainer who is not only supporting us but also very happily works
on improving `prek` to close all the gaps, and plans to implement (with
our support of course and cooperation) monorepo support - that will
allow us to modularise our pre-commits.

This PR switches our pre-commit support to use prek exclusively:

* breeze static checks command is completely removed
* custom auto-complete code in breeze as well
* instructions are updated to setup prek instead of precommit
* CI is updated to run prek instead of pre-commmit
* documentation for static checks is reviewed and new features that
  prek enables are added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:CLI area:dev-tools area:production-image Production image improvements and fixes backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants