cheshirekow / cmake-format-precommit Goto Github PK
View Code? Open in Web Editor NEWpre-commit hooks specification for cmake-format
pre-commit hooks specification for cmake-format
The pre-commit autoupdate
command does not pick up versions that are not on the default branch.
Would you please merge v0.6.13
into the master
branch?
After I commented on the other issue, I found a similar thing happened to isort
(pre-commit/pre-commit#1555), and the solution was just putting tags on the default branch (PyCQA/isort#1371).
When one wants to use configuration files in the YAML format, cmake-format
and cmake-lint
require pyyaml
(ref. cmake-format: Configuration).
In the pre-commit framework, users can overwrite additional_dependencies
in their .pre-commit-config.yaml
to work with YAML configuration files:
repos:
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.5
hooks:
- id: cmake-format
additional_dependencies: [cmake-format==0.6.5, pyyaml==5.3]
- id: cmake-lint
additional_dependencies: [cmake-format==0.6.5, pyyaml==5.3]
but, as you see, one has to write the version number 0.6.5
3 times in this case. This doesn't look cool.
I come up with the following 2 options to improve the above point:
Always install pyyaml
to the (isolated) pre-commit environment anyway. So, set additional_dependencies: [cmake-format==0.6.5, pyyaml==5.3]
in .pre-commit-hooks.yaml
.
Install cmake-format
by the install_requires
option of the setup
and leave additional_dependencies
in .pre-commit-hooks.yaml
blank by default. (See mirrors-mypy as an example.) Then users can optionally add additional_dependencies: [pyyaml==5.3]
in their .pre-commit-config.yaml
.
Some commands seem to require it, i.e.
https://github.com/cheshirekow/cmake_format/blob/eff5df1f41c665ea7cac799396042e4f406ef09a/cmakelang/format/__main__.py#L208-L220
These should be included in this precommit package
Is it possible to combine this repo with the cmake-format one? I know at least Black does it all in one repo (see https://black.readthedocs.io/en/stable/version_control_integration.html). They are sadly out of sync - I copied and pasted from here: https://cmake-format.readthedocs.io/en/latest/installation.html#pre-commit :
repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.11
hooks:
- id: cmake-format
And got an error about v0.6.11 not existing, since there's no release here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.