You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/02/21 19:38:54 UTC

[GitHub] [apisix] jbampton commented on a change in pull request #3624: feat: add pre-commit framework

jbampton commented on a change in pull request #3624:
URL: https://github.com/apache/apisix/pull/3624#discussion_r579854737



##########
File path: .pre-commit-config.yaml
##########
@@ -0,0 +1,76 @@
+#
+# 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.
+#
+---
+default_stages: [commit, push]
+default_language_version:
+  # force all unspecified Python hooks to run python3
+  python: python3
+minimum_pre_commit_version: "1.20.0"
+repos:
+  - repo: meta
+    hooks:
+      - id: identity
+      - id: check-hooks-apply
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v3.4.0
+    hooks:
+      - id: check-case-conflict
+      - id: check-json
+      - id: check-merge-conflict
+      - id: check-xml
+      - id: check-yaml
+      - id: end-of-file-fixer
+      - id: mixed-line-ending
+      - id: pretty-format-json
+      # - id: check-executables-have-shebangs
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v3.4.0
+    hooks:
+      - id: trailing-whitespace
+        exclude: ^t/node/remote-addr-ipv6.t$
+  - repo: https://github.com/psf/black
+    rev: 20.8b1
+    hooks:
+      - id: black
+        name: Run black on Python files
+  - repo: https://github.com/asottile/dead
+    rev: v1.4.0
+    hooks:
+      - id: dead
+        name: Dead simple python dead code detection
+  # - repo: git://github.com/Lucas-C/pre-commit-hooks
+  #  rev: v1.1.9
+  #  hooks:
+  #    - id: forbid-tabs
+  #    - id: remove-tabs
+  # - repo: https://github.com/Calinou/pre-commit-luacheck

Review comment:
       I was not able to get the `luacheck` to pass for all files -> `pre-commit run --all-files`
   
   So I have commented it out for now.  
   
   I think it's failing on these warning messages:
   
   <img width="731" alt="Screen Shot 2021-02-22 at 5 28 11 am" src="https://user-images.githubusercontent.com/418747/108636276-01f84700-74d0-11eb-9098-98fcc1a36ea7.png">
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org