summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-01-30 18:17:25 -0500
committerNed Batchelder <ned@nedbatchelder.com>2023-01-30 18:24:25 -0500
commitdba1bc3a73482a30a71c24788829cb220689848b (patch)
tree4c57da65a859529772bdbdbee68f288c1cb89004
parenteb3536ddff194b126d52b94d72b81d77296fa869 (diff)
downloadpython-coveragepy-git-dba1bc3a73482a30a71c24788829cb220689848b.tar.gz
build: no need for check_eol, pylint does most of it
-rw-r--r--igor.py72
-rw-r--r--tox.ini1
2 files changed, 0 insertions, 73 deletions
diff --git a/igor.py b/igor.py
index 248b93f5..ad0dbf8c 100644
--- a/igor.py
+++ b/igor.py
@@ -10,7 +10,6 @@ of in shell scripts, batch files, or Makefiles.
import contextlib
import datetime
-import fnmatch
import glob
import inspect
import os
@@ -277,77 +276,6 @@ def do_zip_mods():
zf.write("coverage/__main__.py", "__main__.py")
-def do_check_eol():
- """Check files for incorrect newlines and trailing white space."""
-
- ignore_dirs = [
- '.svn', '.hg', '.git',
- '.tox*',
- '*.egg-info',
- '_build',
- '_spell',
- 'tmp',
- 'help',
- ]
- checked = set()
-
- def check_file(fname, crlf=True, trail_white=True):
- """Check a single file for white space abuse."""
- fname = os.path.relpath(fname)
- if fname in checked:
- return
- checked.add(fname)
-
- line = None
- with open(fname, "rb") as f:
- for n, line in enumerate(f, start=1):
- if crlf:
- if b"\r" in line:
- print(f"{fname}@{n}: CR found")
- return
- if trail_white:
- line = line[:-1]
- if not crlf:
- line = line.rstrip(b'\r')
- if line.rstrip() != line:
- print(f"{fname}@{n}: trailing white space found")
- return
-
- if line is not None and not line.strip():
- print(f"{fname}: final blank line")
-
- def check_files(root, patterns, **kwargs):
- """Check a number of files for white space abuse."""
- for where, dirs, files in os.walk(root):
- for f in files:
- fname = os.path.join(where, f)
- for p in patterns:
- if fnmatch.fnmatch(fname, p):
- check_file(fname, **kwargs)
- break
- for ignore_dir in ignore_dirs:
- ignored = []
- for dir_name in dirs:
- if fnmatch.fnmatch(dir_name, ignore_dir):
- ignored.append(dir_name)
- for dir_name in ignored:
- dirs.remove(dir_name)
-
- check_files("coverage", ["*.py"])
- check_files("coverage/ctracer", ["*.c", "*.h"])
- check_files("coverage/htmlfiles", ["*.html", "*.scss", "*.css", "*.js"])
- check_files("tests", ["*.py"])
- check_files("tests", ["*,cover"], trail_white=False)
- check_files("tests/js", ["*.js", "*.html"])
- check_file("setup.py")
- check_file("igor.py")
- check_file("Makefile")
- check_files(".", ["*.rst", "*.txt"])
- check_files(".", ["*.pip"])
- check_files(".github", ["*"])
- check_files("ci", ["*"])
-
-
def print_banner(label):
"""Print the version of Python."""
try:
diff --git a/tox.ini b/tox.ini
index 9fc3b5f3..a323d136 100644
--- a/tox.ini
+++ b/tox.ini
@@ -77,7 +77,6 @@ setenv =
commands =
python -m tabnanny {env:LINTABLE}
- python igor.py check_eol
# If this command fails, see the comment at the top of doc/cmd.rst
python -m cogapp -cP --check --verbosity=1 doc/*.rst
python -m cogapp -cP --check --verbosity=1 .github/workflows/*.yml