You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2022/05/16 09:07:57 UTC
[arrow] branch master updated: ARROW-16531: [Dev] Update pre-commit to use latest flake8 and remove unsupported cython linting
This is an automated email from the ASF dual-hosted git repository.
apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 940ab93af6 ARROW-16531: [Dev] Update pre-commit to use latest flake8 and remove unsupported cython linting
940ab93af6 is described below
commit 940ab93af6a6496d294c5a3f70709bde597ca548
Author: Raúl Cumplido <ra...@gmail.com>
AuthorDate: Mon May 16 11:07:46 2022 +0200
ARROW-16531: [Dev] Update pre-commit to use latest flake8 and remove unsupported cython linting
This PR tries to update and make consistent our linting for Python between archery and pre-commit by removing the checks for cython files. Flake8 does not support Cython linting, see [this conversation](https://github.com/PyCQA/flake8/issues/1482) for more details.
Closes #13129 from raulcd/ARROW-16531
Authored-by: Raúl Cumplido <ra...@gmail.com>
Signed-off-by: Antoine Pitrou <an...@python.org>
---
.pre-commit-config.yaml | 24 +++++++++---------------
dev/archery/archery/utils/lint.py | 3 ---
python/.flake8.cython | 20 --------------------
3 files changed, 9 insertions(+), 38 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0718072308..7fd35b1aa8 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -36,19 +36,13 @@ repos:
- dockerfile
entry: --entrypoint /bin/hadolint hadolint/hadolint:latest -
exclude: ^dev/.*$
- - repo: git://github.com/pre-commit/pre-commit-hooks
- sha: v1.2.3
+ - repo: https://github.com/pycqa/flake8
+ rev: 4.0.1
hooks:
- - id: flake8
- name: Python Format
- files: ^(python|dev|integration)/
- types:
- - file
- - python
- - id: flake8
- name: Cython Format
- files: ^python/
- types:
- - file
- - cython
- args: [--config=python/.flake8.cython]
+ - id: flake8
+ name: Python Format
+ files: ^(python|dev|integration)/
+ types:
+ - file
+ - python
+ exclude: vendored
diff --git a/dev/archery/archery/utils/lint.py b/dev/archery/archery/utils/lint.py
index 6c01a349a3..696dafe2b5 100644
--- a/dev/archery/archery/utils/lint.py
+++ b/dev/archery/archery/utils/lint.py
@@ -230,9 +230,6 @@ def python_linter(src, fix=False):
flake8("--extend-exclude=" + ','.join(flake8_exclude),
setup_py, src.pyarrow, os.path.join(src.python, "examples"),
src.dev, check=False))
- config = os.path.join(src.python, ".flake8.cython")
- yield LintResult.from_cmd(
- flake8("--config=" + config, src.pyarrow, check=False))
def python_numpydoc(symbols=None, allow_rules=None, disallow_rules=None):
diff --git a/python/.flake8.cython b/python/.flake8.cython
deleted file mode 100644
index 4bc195838a..0000000000
--- a/python/.flake8.cython
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-[flake8]
-filename = *.pyx,*.pxd,*.pxi
-ignore = E211,E901,E999,E225,E226,E227,W504