-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Closed
Labels
Description
Opening a file without an encoding can cause issues on Windows, there's been some reports from people trying to contribute on Windows running into this
pylint has a check for this, so let's enable it (I've been learning some Rust, so I'll try to get it in to Ruff so it can run in a reasonable amount of time and we can later use that instead - but for now a manual pylint check is fine)
Task here is:
- make the following change to
.pre-commit-config.yaml
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 43b3699907..34cd91940f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -83,9 +83,6 @@ repos:
hooks:
- id: pylint
stages: [manual]
-- repo: https://github.com/pycqa/pylint
- rev: v2.16.2
- hooks:
- id: pylint
alias: redefined-outer-name
name: Redefining name from outer scope
@@ -99,6 +96,11 @@ repos:
|^pandas/conftest\.py # keep excluded
args: [--disable=all, --enable=redefined-outer-name]
stages: [manual]
+ - id: pylint
+ alias: unspecified-encoding
+ name: Using open without explicitly specifying an encoding
+ args: [--disable=all, --enable=unspecified-encoding]
+ stages: [manual]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:- run
pre-commit run unspecified-encoding --hook-stage manual --all-files - fixup all the violations it reports (by using
encoding='utf-8'), stage, commit, push, open pull request, celebrate
No need to ask for permission to work on this:
- just comment
takeand it will be assigned to you - if someone else has commented
takea week has passed and they haven't done anything (a common occurrence, unfortunately), then feel free to take over. Please only commenttakeif you intend to work on this