Improve pre-commit config (#9563)

- Add a few more hooks. These are all very fast, and I've found them useful in other projects:
  - Autofixes:
    - `trailing-whitespace`: fixes trailing whitespace
    - `requirements-txt-fixer`: alphabetises items in `requirements.txt` files
    - `end-of-file-fixer`: makes sure every file ends with a single newline character
    - `mixed-line-ending`: Makes sure Windows users don't accidentally introduce CRLF line endings into a file that uses LF line endings
  - None-autofixes:
    - `check-yaml`: loads YAML files to validate syntax
    - `check-toml`: loads TOML files to validate syntax
    - `check-merge-conflict`: detects merge-conflict strings in files and blocks them from accidentally being committed
    - `check-case-conflict`: checks for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT; blocks them from being committed.
  - Change the bot schedule to quarterly, to reduce noisy PRs
  - Change the `black` language target-version to Python 3.10, synching the setting here with the changes that were made to our `pyproject.toml` file in #7538
This commit is contained in:
Alex Waygood
2023-01-18 14:29:18 +00:00
committed by GitHub
parent aa4d6d87ae
commit a4e3cfefac
14 changed files with 30 additions and 19 deletions

View File

@@ -63,4 +63,3 @@ aiofiles.tempfile.AiofilesContextManagerTempDir
# Helper decorator, too complex to type
aiofiles.os.wrap

View File

@@ -2,4 +2,4 @@
croniter.croniter.EXPANDERS
croniter.croniter.HashExpander
croniter.croniter.VALID_LEN_EXPRESSION
croniter.croniter.timedelta_to_seconds
croniter.croniter.timedelta_to_seconds

View File

@@ -2,4 +2,3 @@ version = "0.6.*"
[tool.stubtest]
ignore_missing_stub = false

View File

@@ -1,2 +1,2 @@
docutils
mock
mock

View File

@@ -1 +1 @@
oauthlib.oauth1.rfc5849.parameters.prepare_headers
oauthlib.oauth1.rfc5849.parameters.prepare_headers

View File

@@ -1,2 +1,2 @@
# "cls" argument has wrong name in implementation.
openpyxl.descriptors.slots.AutoSlotProperties.__new__
openpyxl.descriptors.slots.AutoSlotProperties.__new__

View File

@@ -1 +1 @@
version = "2.9.*"
version = "2.9.*"

View File

@@ -1,4 +1,4 @@
# Some methods are dynamically patched onto to instances as they
# Some methods are dynamically patched onto to instances as they
# may depend on whether code is executed in graph/eager/v1/v2/etc.
# Tensorflow supports multiple modes of execution which changes some
# of the attributes/methods/even class hierachies.
@@ -17,6 +17,6 @@ tensorflow.Operation.__getattr__
tensorflow.Variable.__getattr__
# Internal undocumented API
tensorflow.RaggedTensor.__init__
# Has an undocumented extra argument that tf.Variable which acts like subclass
# Has an undocumented extra argument that tf.Variable which acts like subclass
# (by dynamically patching tf.Tensor methods) does not preserve.
tensorflow.Tensor.__getitem__
tensorflow.Tensor.__getitem__

View File

@@ -1,4 +1,4 @@
tensorflow
pandas
dask
pandas
rich
tensorflow