diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e9a1ec890fba..443789f9f46d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: name: Generate pip dependency from conda description: This hook checks if the conda environment.yml and requirements-dev.txt are equal language: python - entry: python -m scripts.generate_pip_deps_from_conda + entry: python scripts/generate_pip_deps_from_conda.py files: ^(environment.yml|requirements-dev.txt)$ pass_filenames: false additional_dependencies: [pyyaml] @@ -102,23 +102,23 @@ repos: - id: unwanted-patterns-strings-to-concatenate name: Check for use of not concatenated strings language: python - entry: ./scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate" + entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate" files: \.(py|pyx|pxd|pxi)$ - id: unwanted-patterns-strings-with-wrong-placed-whitespace name: Check for strings with wrong placed spaces language: python - entry: ./scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace" + entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace" files: \.(py|pyx|pxd|pxi)$ - id: unwanted-patterns-private-import-across-module name: Check for import of private attributes across modules language: python - entry: ./scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module" + entry: python scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module" types: [python] exclude: ^(asv_bench|pandas/_vendored|pandas/tests|doc)/ - id: unwanted-patterns-private-function-across-module name: Check for use of private functions across modules language: python - entry: ./scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module" + entry: python scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module" types: [python] exclude: ^(asv_bench|pandas/_vendored|pandas/tests|doc)/ - repo: https://github.com/asottile/yesqa diff --git a/scripts/validate_unwanted_patterns.py b/scripts/validate_unwanted_patterns.py index f824980a6d7e1..7b648a589bc61 100755 --- a/scripts/validate_unwanted_patterns.py +++ b/scripts/validate_unwanted_patterns.py @@ -432,7 +432,7 @@ def main( is_failed: bool = False for file_path in source_path: - with open(file_path) as file_obj: + with open(file_path, encoding="utf-8") as file_obj: for line_number, msg in function(file_obj): is_failed = True print(