Skip to content

Document pre-commit framework integration #5373

@AleksaC

Description

@AleksaC

What is the problem you're trying to solve?

I want to be able to use stylelint with pre-commit framework. The biggest selling point of pre-commit is that in addition to managing git hooks it also installs them in isolated environments making configuration as simple as specifying them in a single yaml file. It is especially good for projects that use multiple languages as it supports hooks in over a dozen languages.

I saw that docs currently mention this repo. However the solution has no benefits over just using repo: local and since it doesn't mirror stylelint releases it is actually worse than using local repo. One of the downsides of using solutions like that is that the hooks can't be updated using pre-commit's autoupdate command and need to be updated manually. Also I think that they make less use of pre-commit's cache if they are used across many repositories.

What solution would you like to see?

To be able to use this repo, pre-commit needs a little bit of metadata that needs to be put inside .pre-commit-hooks.yaml file. This is a simple config that shouldn't change much over time and therefore would require little to no maintenance.

While writing this issue I came across a comment where the author of pre-commit suggests adding pre-commit support to this repo as a preferred solution for using stylelint with pre-commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions