Skip to content

Commit 3c695dc

Browse files
authored
fix windows issue pre-commit (#37419)
Co-authored-by: Marco Gorelli <[email protected]>
1 parent c85fbc7 commit 3c695dc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ repos:
4141
name: Generate pip dependency from conda
4242
description: This hook checks if the conda environment.yml and requirements-dev.txt are equal
4343
language: python
44-
entry: python -m scripts.generate_pip_deps_from_conda
44+
entry: python scripts/generate_pip_deps_from_conda.py
4545
files: ^(environment.yml|requirements-dev.txt)$
4646
pass_filenames: false
4747
additional_dependencies: [pyyaml]
@@ -102,23 +102,23 @@ repos:
102102
- id: unwanted-patterns-strings-to-concatenate
103103
name: Check for use of not concatenated strings
104104
language: python
105-
entry: ./scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
105+
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
106106
files: \.(py|pyx|pxd|pxi)$
107107
- id: unwanted-patterns-strings-with-wrong-placed-whitespace
108108
name: Check for strings with wrong placed spaces
109109
language: python
110-
entry: ./scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
110+
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
111111
files: \.(py|pyx|pxd|pxi)$
112112
- id: unwanted-patterns-private-import-across-module
113113
name: Check for import of private attributes across modules
114114
language: python
115-
entry: ./scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module"
115+
entry: python scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module"
116116
types: [python]
117117
exclude: ^(asv_bench|pandas/_vendored|pandas/tests|doc)/
118118
- id: unwanted-patterns-private-function-across-module
119119
name: Check for use of private functions across modules
120120
language: python
121-
entry: ./scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module"
121+
entry: python scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module"
122122
types: [python]
123123
exclude: ^(asv_bench|pandas/_vendored|pandas/tests|doc)/
124124
- repo: https://github.com/asottile/yesqa

scripts/validate_unwanted_patterns.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def main(
432432
is_failed: bool = False
433433

434434
for file_path in source_path:
435-
with open(file_path) as file_obj:
435+
with open(file_path, encoding="utf-8") as file_obj:
436436
for line_number, msg in function(file_obj):
437437
is_failed = True
438438
print(

0 commit comments

Comments
 (0)