Skip to content

Commit 4490525

Browse files
Add pre-commit hooks for autofixing trailing whitespace (#15237)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2df6f36 commit 4490525

32 files changed

+31
-30
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Adopt black and isort
2-
97c5ee99bc98dc475512e549b252b23a6e7e0997
2+
97c5ee99bc98dc475512e549b252b23a6e7e0997

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
exclude: '^(mypyc/external/)|(mypy/typeshed/)' # Exclude all vendored code from lints
12
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.4.0 # must match test-requirements.txt
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
28
- repo: https://github.com/psf/black
39
rev: 23.3.0 # must match test-requirements.txt
410
hooks:

mypyc/lib-rt/bytes_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "CPy.h"
77

88
// Returns -1 on error, 0 on inequality, 1 on equality.
9-
//
9+
//
1010
// Falls back to PyObject_RichCompareBool.
1111
int CPyBytes_Compare(PyObject *left, PyObject *right) {
1212
if (PyBytes_CheckExact(left) && PyBytes_CheckExact(right)) {

mypyc/test-data/irbuild-dict.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,4 +583,3 @@ L2:
583583
L3:
584584
r7 = box(None, 1)
585585
return r7
586-

mypyc/test-data/irbuild-nested.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,4 +859,3 @@ L2:
859859
r2 = baz(r1)
860860
r3 = CPyTagged_Add(n, r2)
861861
return r3
862-

mypyc/test-data/irbuild-set.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,4 +836,3 @@ L4:
836836
r11 = CPy_NoErrOccured()
837837
L5:
838838
return 1
839-

mypyc/test-data/irbuild-strip-asserts.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ L0:
1010
r0 = object 3
1111
x = r0
1212
return x
13-

mypyc/test-data/run-bools.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,4 @@ def test_mixed_comparisons_i64() -> None:
226226
y = False
227227
print((y or 0) and True)
228228
[out]
229-
0
229+
0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bar_var: str
1+
bar_var: str
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bar_var = "bar"
1+
bar_var = "bar"

0 commit comments

Comments
 (0)