Skip to content

Commit bb98a38

Browse files
authored
Remove pylint check (#985)
* Remove pylint check This PR removes pylint check, as was discussed in 980. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Also remove pylint in .github/workflows/build.yml Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Add empty commit to push GitHub CI Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
1 parent 0a6dff9 commit bb98a38

File tree

8 files changed

+7
-453
lines changed

8 files changed

+7
-453
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
BAZEL_OS=$(uname | tr '[:upper:]' '[:lower:]')
2626
curl -sSOL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh
2727
sudo bash -e bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh
28-
bazel run -s --verbose_failures //tools/lint:check -- bazel pylint pyupgrade black
28+
bazel run -s --verbose_failures //tools/lint:check -- bazel pyupgrade black
2929
3030
macos:
3131
name: macOS

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ version of TensorFlow I/O according to the table below:
114114

115115
### Lint
116116

117-
TensorFlow I/O's code conforms through Pylint, Bazel Buildifier, Clang Format, Black, and Pyupgrade. The following will check the source code and report any lint issues:
117+
TensorFlow I/O's code conforms through Bazel Buildifier, Clang Format, Black, and Pyupgrade. The following will check the source code and report any lint issues:
118118
```sh
119119
bazel run //tools/lint:check
120120
```
@@ -124,11 +124,11 @@ For Bazel Buildifier and Clang Format, the following will automatically fix and
124124
bazel run //tools/lint:lint
125125
```
126126

127-
Alternatively, if you only want to perform lint check on one aespect, then you can selectively pass `pylint`, `bazel`, or `clang` from the above commands.
127+
Alternatively, if you only want to perform one lint check individually, then you can selectively pass `black`, `pyupgrade`, `bazel`, or `clang` from the above commands.
128128

129-
For example, check with Pylint only could be done with:
129+
For example, check with `black` only could be done with:
130130
```
131-
bazel run //tools/lint:check -- pylint
131+
bazel run //tools/lint:check -- black
132132
```
133133

134134
Fix with Bazel Buildifier or Clang Format could be done with:

tools/lint/BUILD

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -62,38 +62,6 @@ genrule(
6262
],
6363
)
6464

65-
py_binary(
66-
name = "pylint_py",
67-
srcs = ["pylint_python.py"],
68-
main = "pylint_python.py",
69-
deps = [
70-
requirement("pylint"),
71-
requirement("wrapt"),
72-
requirement("astroid"),
73-
requirement("isort"),
74-
requirement("lazy_object_proxy"),
75-
],
76-
)
77-
78-
filegroup(
79-
name = "pylint_rc",
80-
srcs = [
81-
"pylint_python.rc",
82-
],
83-
)
84-
85-
genrule(
86-
name = "pylint",
87-
srcs = [],
88-
outs = ["pylint"],
89-
cmd = "echo '$(location :pylint_py) --rcfile=$(location :pylint_rc) \"$$@\"' > $@",
90-
executable = True,
91-
tools = [
92-
":pylint_py",
93-
":pylint_rc",
94-
],
95-
)
96-
9765
genrule(
9866
name = "clang_format",
9967
srcs = ["@llvm_toolchain//:bin/clang-format"],

tools/lint/defs.bzl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ def _lint_impl(ctx):
55
substitutions = {
66
"@@MODE@@": shell.quote(ctx.attr.mode),
77
"@@BLACK_PATH@@": shell.quote(ctx.executable._black.short_path),
8-
"@@PYLINT_PATH@@": shell.quote(ctx.executable._pylint.short_path),
98
"@@BUILDIFIER_PATH@@": shell.quote(ctx.executable._buildifier.short_path),
109
"@@CLANG_FORMAT_PATH@@": shell.quote(ctx.executable._clang_format.short_path),
1110
"@@PYUPGRADE_PATH@@": shell.quote(ctx.executable._pyupgrade.short_path),
@@ -16,7 +15,7 @@ def _lint_impl(ctx):
1615
substitutions = substitutions,
1716
is_executable = True,
1817
)
19-
runfiles = ctx.runfiles(files = [ctx.executable._buildifier, ctx.executable._clang_format, ctx.executable._pylint, ctx.executable._black, ctx.executable._pyupgrade])
18+
runfiles = ctx.runfiles(files = [ctx.executable._buildifier, ctx.executable._clang_format, ctx.executable._black, ctx.executable._pyupgrade])
2019
return [DefaultInfo(
2120
files = depset([bash_file]),
2221
runfiles = runfiles,
@@ -36,11 +35,6 @@ _lint = rule(
3635
cfg = "host",
3736
executable = True,
3837
),
39-
"_pylint": attr.label(
40-
default = "//tools/lint:pylint",
41-
cfg = "host",
42-
executable = True,
43-
),
4438
"_buildifier": attr.label(
4539
default = "@com_github_bazelbuild_buildtools//buildifier",
4640
cfg = "host",

tools/lint/lint.tpl

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ echo "$MODE: " $@
88
RUN_BAZEL=no
99
RUN_BLACK=no
1010
RUN_CLANG=no
11-
RUN_PYLINT=no
1211
RUN_PYUPGRADE=no
1312
RUN_ENTRIES=all
1413
if [[ $# -eq 0 ]]; then
1514
RUN_BAZEL=true
1615
RUN_BLACK=true
1716
RUN_CLANG=true
18-
RUN_PYLINT=true
1917
RUN_PYUPGRADE=true
2018
else
2119
while [[ $# -gt 0 ]]; do
@@ -31,10 +29,6 @@ else
3129
shift
3230
echo "$MODE: " clang
3331
RUN_CLANG=true
34-
elif [[ "$1" == "pylint" ]]; then
35-
shift
36-
echo "$MODE: " pylint
37-
RUN_PYLINT=true
3832
elif [[ "$1" == "pyupgrade" ]]; then
3933
shift
4034
echo "$MODE: " pyupgrade
@@ -51,38 +45,26 @@ else
5145
done
5246
fi
5347

54-
echo "Selected: Bazel=$RUN_BAZEL Black=$RUN_BLACK Clang=$RUN_CLANG Pylint=$RUN_PYLINT Pyupgrade=$RUN_PYUPGRADE [Entries]: $RUN_ENTRIES"
48+
echo "Selected: Bazel=$RUN_BAZEL Black=$RUN_BLACK Clang=$RUN_CLANG Pyupgrade=$RUN_PYUPGRADE [Entries]: $RUN_ENTRIES"
5549

5650
BLACK_PATH=@@BLACK_PATH@@
57-
PYLINT_PATH=@@PYLINT_PATH@@
5851
BUILDIFIER_PATH=@@BUILDIFIER_PATH@@
5952
CLANG_FORMAT_PATH=@@CLANG_FORMAT_PATH@@
6053
PYUPGRADE_PATH=@@PYUPGRADE_PATH@@
6154

6255
mode="$MODE"
6356

6457
black_path=$(readlink "$BLACK_PATH")
65-
pylint_path=$(readlink "$PYLINT_PATH")
6658
buildifier_path=$(readlink "$BUILDIFIER_PATH")
6759
clang_format_path=$(readlink "$CLANG_FORMAT_PATH")
6860
pyupgrade_path=$(readlink "$PYUPGRADE_PATH")
6961

7062
echo "mode:" $mode
7163
echo "black:" $black_path
72-
echo "pylint:" $pylint_path
7364
echo "buildifier:" $buildifier_path
7465
echo "clang-format:" $clang_format_path
7566
echo "pyupgrade:" $pyupgrade_path
7667

77-
if [[ "$mode" == "lint" ]]; then
78-
if [[ "$RUN_PYLINT" == "true" ]]; then
79-
echo
80-
echo "WARN: pylint does not have lint mode, use check instead"
81-
echo
82-
fi
83-
fi
84-
85-
8668
black_func() {
8769
echo $1 $2
8870
if [[ "$1" == "lint" ]]; then
@@ -92,16 +74,6 @@ black_func() {
9274
fi
9375
}
9476

95-
pylint_func() {
96-
echo $1 $2
97-
# Note: --indent-string=' ' to override google 2 spaces and match black
98-
# Note: --max-line-length=88 to override default and match black
99-
# Note: --disable=bad-continuation to avoid conflict with black
100-
# TODO: --disable=abstract-method should be removed eventually
101-
# TODO: --disable=abstract-class-instantiated should be removed eventually
102-
$pylint_path --indent-string=' ' --max-line-length=88 --disable=bad-continuation --disable=abstract-method --disable=abstract-class-instantiated $2
103-
}
104-
10577
buildifier_func() {
10678
echo $1 $2
10779
if [[ "$1" == "lint" ]]; then
@@ -157,31 +129,6 @@ fi
157129
fi
158130

159131

160-
if [[ "$RUN_PYLINT" == "true" ]]; then
161-
echo "Run Pylint"
162-
163-
if [[ "$RUN_ENTRIES" == "--" ]]; then
164-
( \
165-
cd "$BUILD_WORKSPACE_DIRECTORY" && \
166-
for i in $@ ; do \
167-
pylint_func $mode "$i" ; \
168-
done \
169-
)
170-
else
171-
( \
172-
cd "$BUILD_WORKSPACE_DIRECTORY" && \
173-
for i in \
174-
$( \
175-
find tensorflow_io tests -type f \
176-
\( -name '*.py' \) \
177-
) ; do \
178-
pylint_func $mode "$i" ; \
179-
done \
180-
)
181-
fi
182-
183-
fi
184-
185132
if [[ "$RUN_BAZEL" == "true" ]]; then
186133
echo "Run Bazel Buildifier"
187134

tools/lint/pylint_python.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)