Skip to content

Document how to only run pre-push with the pre-commit integration #9924

Open
@davetapley

Description

@davetapley

Question

The pre-commit integration docs helpfully say:

[..] pylint -- due to its speed -- is more suited to a [..] git pre-push hook

And then gives an example .pre-commit-config.yaml which doesn't specify stages: [push].

As someone who isn't familiar with .pre-commit-config.yaml it took some digging to find the relevant documentation for pre-commit.

Would a PR be welcome to make include here?

Documentation for future user

Link to the relevant documentation for pre-commit.

A .pre-commit-config.yaml which includes stages:

- repo: local
  hooks:
    - id: pylint
      name: pylint
      entry: pylint
      language: system
      types: [python]
      stages: [push]
      require_serial: true
      args:
        [
          "-rn", # Only display messages
          "-sn", # Don't display the score
        ]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions