Comments (9)
have a look at this commit, i used the all-repos.json
file and parsed all attributes of the hooks (fallback are the default values listed on pre-commit.com).
let me know if this is what you've imagined and if you have comments on it.
from pre-commit.com.
looks like a good start! I imagine the version information would be useful as well -- is there a second mechanism for parsing .pre-commit-config.yaml
from consuming repositories? to be honest I can't remember why this was useful (I think it was so a third party could integrate with showing packaging mappings / use)
from pre-commit.com.
the reason why i commented out the self.version
method is because libraries.io then automatic gets the latest tag (either you define your one version or it uses git tags. this can also be seen in the compatibility matrix). this is similar to the emacs-packages.
not sure if i understood you correct regarding consuming repositories: do you mean parsing the additional_dependencies
-field? i can add this for all languages that are listed in libraries.io (node, python via pypi, go). Here's an example of what i mean:
{
"https://github.com/pre-commit/mirrors-coffeelint": [
{
"id": "coffeelint",
"name": "coffeelint",
"entry": "coffeelint",
"language": "node",
"files": "\\.(js|coffee)$",
"args": [],
"additional_dependencies": ["[email protected]"],
"minimum_pre_commit_version": "0.7.0"
}
]
}
would return the following in self.dependencies
:
[
{
project_name: 'coffeelint',
requirements: 2.1.0,
kind: 'runtime',
platform: 'npm'
}
]
from pre-commit.com.
ah no not additional_dependencies (though maybe that's worth doing too? idk?) -- I was thinking more like if you looked at https://github.com/asottile/t for example it would have dependencies on github.com/pre-commit/pre-commit-hooks, ... based on its consuming .pre-commit-config.yaml
I don't know how that gets represented in libraries.io though π€
from pre-commit.com.
oh ok, if i understood the documentation correct, this is done by bibliothecary (if you log in to libraries.io, this will check your repositories for dependencies). i added pre-commit to bibliothecary here.
from pre-commit.com.
neat, that looks good -- though you'll want to skip repo: meta
and repo: local
from pre-commit.com.
neat, that looks good -- though you'll want to skip
repo: meta
andrepo: local
yeah thanks, i'm going to to change this.
from pre-commit.com.
i just tried adding the parsing of additional_dependencies
, but encountered two problems:
- most languages have multiple package managers in libraries.io, but we are required to specify which one the dependency uses. it would be possible to search for the corresponding package manager in libraries.io, but this would be quite expensive and might cause errors if the same name is specified in multiple package managers
- the dependencies wouldn't be consistent, as not all
additional_dependencies
can be found on libraries.io, which kind of ruins the purpose imo
let me know what you think about adding this or if you have any suggestions
from pre-commit.com.
feel free to skip additional_dependencies π
from pre-commit.com.
Related Issues (20)
- Link to `default_install_hook_types` is not correct HOT 4
- Documentation assumes incorrectly that a tag is an immutable ref - leading to a supply-chain security risk HOT 1
- Add sql-formatter hook HOT 2
- Add `Rome` formatter as a mirror. HOT 2
- Itβs not clear which languages canβt be used for local hooks HOT 3
- Version in docs is out of date HOT 1
- pre-commit ci incorrectly reports an error with the walrus operator (python 3.11) HOT 2
- License still necessary
- Ambiguous documentation HOT 1
- `pretty-format-json` timeout error HOT 3
- Filter hooks by language HOT 1
- Bot keeps bumping ruff-pre-commit to incompatible release HOT 6
- Will a hook be accepted if one of the hooks in `.pre-commit-hooks.yaml` is `system`? HOT 3
- [pre-commit]: Spellcheck hook for source code and gitlab/github for commit messages and MR/PR descriptions HOT 1
- If possible, please remove stackoverflow from https://pre-commit.com/#getting-help HOT 2
- Hook fail_fast stops pre-commit if any prior hook fails HOT 2
- pipx installation option HOT 5
- Add Dark Theme HOT 1
- Can we have a CONTRIBUTING.md document? HOT 2
- Selectively skipping pre-commit hooks on Windows HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pre-commit.com.