potiuk commented on a change in pull request #5238: [AIRFLOW-4364] Add Pylint to CI URL: https://github.com/apache/airflow/pull/5238#discussion_r281034156
########## File path: scripts/ci/ci_pylint.py ########## @@ -0,0 +1,104 @@ +# 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. + +"""This script runs Pylint and filters out only the changed lines.""" +# TODO remove this script once the complete Airflow codebase is Pylint compatible. + +import os +import re +import subprocess +import sys +from io import StringIO + +from collections import defaultdict +from pathlib import Path + +from pylint import lint +from pylint.reporters.text import ColorizedTextReporter + +# Get Python files to run Pylint against. +# Git command from https://github.com/sk-/git-lint/blob/master/gitlint/git.py +git_modified_files_cmd = "git status --porcelain --untracked-files=all --ignore-submodules=all".split() Review comment: I understand think this command will return no files in CI, but the purpose is to run tests on all locally modified files only. Maybe we should mention somewhere in the readme that the script might be run locally, not only in CI environment then (and how). ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
