Testing gitlint

This commit is contained in:
dvanaken
2019-10-23 15:59:22 -04:00
committed by Dana Van Aken
parent 9f3fe29c27
commit 5c855faa3e
11 changed files with 539 additions and 241 deletions

View File

@@ -79,9 +79,6 @@ EXCLUDE_FILES = [
os.path.join(OTTERTUNE_DIR, 'server/analysis/simulation.py'),
]
CHECKSTYLE_JAR_PATH = os.path.join(OTTERTUNE_DIR,
"client/controller/build/libs/checkstyle-8.8-all.jar")
# Regex patterns
PYCODESTYLE_COMMENT_PATTERN = re.compile(r'#\s*pycodestyle:\s*disable\s*=\s*[\w\,\s]+$')
@@ -326,14 +323,9 @@ def check_java_checkstyle(file_path, config_path=None):
if not file_path.endswith(".java"):
return True, None
if not os.path.exists(CHECKSTYLE_JAR_PATH):
with lcd(os.path.join(OTTERTUNE_DIR, "client/controller")): # pylint: disable=not-context-manager
local("gradle downloadJars")
options = '' if config_path is None else '-c ' + config_path
with quiet():
res = local("java -jar {} {} {}".format(CHECKSTYLE_JAR_PATH, options, file_path),
capture=True)
res = local("checkstyle {} {}".format(options, file_path), capture=True)
lines = res.stdout.split('\n')
assert len(lines) >= 2 and lines[0] == "Starting audit..." and lines[-1] == "Audit done."
if len(lines) == 2: