Metadata-Version: 2.3
Name: sbrunner-hooks
Version: 1.4.1
Summary: Pre commit hook by sbrunner
License: BSD-2-Clause
Keywords: pre-commit
Author: Stéphane Brunner
Author-email: stephane.brunner@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Dist: PyYAML (==6.0.2)
Requires-Dist: multi-repo-automation (==1.7.0)
Requires-Dist: ruamel-yaml (==0.18.10)
Project-URL: Repository, https://github.com/sbrunner/hooks
Description-Content-Type: text/markdown

# Pre commit hooks

[pre-commit](https://pre-commit.com/) hook used to...

Check if the copyright is up to date (using the Git history).

## Adding to your `.pre-commit-config.yaml`

```yaml
ci:
  skip:
    # Skip the copyright check on pre-commit.ci because we don't have the Git history
    - copyright
    - copyright-required
    # Poetry didn't works with Python 3.11
    - poetry-lock
    - poetry-check

repos:
  - repo: https://github.com/sbrunner/hooks
    rev: <version> # Use the ref you want to point at
    hooks:
      # Check that the copyright is up to date
      - id: copyright
      # Check that the copyright is present and up to date
      - id: copyright-required
      # Require a timeout in GitHub workflow files
      - id: workflows-require-timeout
      # Check Poetry config
      - id: poetry-check
        additional_dependencies:
          - poetry==<version>
      # Do Poetry lock
      - id: poetry-lock
        additional_dependencies:
          - poetry==<version>
      # Do Pipfile lock
      - id: pipenv-lock
        additional_dependencies:
          - pipenv==<version>
      # Do Helm lock (helm should be installed)
      - id: helm-lock
      - id: npm-lock
```

## Copyright configuration

The default values used in the `.github/copyright.yaml` file.

Default values:

```yaml
one_date_re: ' Copyright \\(c\\) (?P<year>[0-9]{4})"))'
two_date_re: ' Copyright \\(c\\) (?P<from>[0-9]{4})-(?P<to>[0-9]{4})")'
one_date_format: ' Copyright (c) {year}")'
two_date_format: ' Copyright (c) {from}-{to}")'
license_file: LICENSE

one_date_re: ' Copyright \(c\) (?P<year>[0-9]{4})'
two_date_re: ' Copyright \(c\) (?P<from>[0-9]{4})-(?P<to>[0-9]{4})'
one_date_format: ' Copyright (c) {year}'
two_date_format: ' Copyright (c) {from}-{to}'
license_file: LICENSE
```

