Skip to content

pre-commit 2.0 #1260

@asottile

Description

@asottile

This will be the first major breaking release of pre-commit

One final feature release (likely v1.21) will be released before 2.0

These are the planned removals / changes in 2.0:

dropping old python versions

note: despite the pre-commit binary dropping older python versions, it will still be able to run hooks written in those versions as long as virtualenv retains support for those

the plan is to require python3.6+, this will allow a couple of things:

  • removal of python2-specific code
  • type annotations (including variable annotations)

removal of the pcre language

  • pcre has not-the-best cross platform story (broken on windows for particular regexes, requires specific package to be installed via brew on macos)
  • pygrep in most cases is a drop-in replacement for PCRE
  • pygrep was introduced on 2017-10-03 (2 years + 2 months)
  • pcre has been deprecated since 2018-01-13 (1 year + 11 months)

removal of pre-commit autoupdate --tags-only

  • this has been the default behaviour and has produced a warning since 2017-05-16 (2 years + 7 months)

(out of scope, not enough time has elapsed or no warning has been produced)

❌ .pre-commit-config.yaml is always a top-level map

a warning has not been produced for this, it is still marked as TODO and as such cannot break yet

sha -> rev

  • rev has been available since 2018-03-03 (1 year, 9 months)
  • started producing a deprecation warning since 2019-06-06 (6 months)

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