Skip to content

Commit

Permalink
Removes f-string due to 3.5 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
HazardDede committed May 3, 2020
1 parent c068dce commit 5ad31cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions tasks/linting.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,38 @@ def flake8(ctx):
ctx.run("flake8 "
"--max-line-length 120 "
"--ignore=E704,E722,E731,W503 "
f"{SOURCE_PATH}")
"{}".format(SOURCE_PATH))


@task
def pylint(ctx):
"""Runs pylint linter against codebase."""
ctx.run(f"pylint {SOURCE_PATH}")
ctx.run("pylint {}".format(SOURCE_PATH))


@task
def mypy(ctx):
"""Runs the mypy typing linter against the codebase."""
_includes = [
f"{SOURCE_PATH}/logging.py",
f"{SOURCE_PATH}/models.py",
f"{SOURCE_PATH}/selector.py",
f"{SOURCE_PATH}/utils.py",
f"{SOURCE_PATH}/validator.py",
f"{SOURCE_PATH}/engines/*.py",
f"{SOURCE_PATH}/plugins/__init__.py",
f"{SOURCE_PATH}/plugins/pull/__init__.py",
f"{SOURCE_PATH}/plugins/push/__init__.py",
f"{SOURCE_PATH}/plugins/udf/__init__.py"
"{}/logging.py".format(SOURCE_PATH),
"{}/models.py".format(SOURCE_PATH),
"{}/selector.py".format(SOURCE_PATH),
"{}/utils.py".format(SOURCE_PATH),
"{}/validator.py".format(SOURCE_PATH),
"{}/engines/*.py".format(SOURCE_PATH),
"{}/plugins/__init__.py".format(SOURCE_PATH),
"{}/plugins/pull/__init__.py".format(SOURCE_PATH),
"{}/plugins/push/__init__.py".format(SOURCE_PATH),
"{}/plugins/udf/__init__.py".format(SOURCE_PATH)
]
ctx.run(f"mypy {' '.join(_includes)}")
ctx.run("mypy {}".format(' '.join(_includes)))


@task
def configs(ctx):
"""Validates configuration files in configs and docs."""
ctx.run(f"yamllint -c .yamllint {CONFIGS_PATH} {DOCS_PATH}")
ctx.run(f"python {SCRIPTS_PATH}/test_configs.py", pty=True)
ctx.run("yamllint -c .yamllint {configs} {docs}".format(configs=CONFIGS_PATH, docs=DOCS_PATH))
ctx.run("python {}/test_configs.py".format(SCRIPTS_PATH), pty=True)


@task(flake8, pylint, mypy, configs, default=True)
Expand Down
6 changes: 3 additions & 3 deletions tasks/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
def doctest(ctx):
"""Only runs doctests using pytest. Target `pytest` includes doctests."""
ctx.run(
f"pytest --verbose --color=yes --doctest-modules {SOURCE_PATH}"
"pytest --verbose --color=yes --doctest-modules {}".format(SOURCE_PATH)
)


Expand All @@ -34,8 +34,8 @@ def pytest(ctx):
"pytest --verbose --color=yes "
"--durations=10 "
"--doctest-modules "
f"--cov={SOURCE_PATH} --cov-report html --cov-report term {TEST_PATH} "
f"{SOURCE_PATH}",
"--cov={source} --cov-report html --cov-report term {test} "
"{source}".format(source=SOURCE_PATH, test=TEST_PATH),
pty=True
)

Expand Down

0 comments on commit 5ad31cd

Please sign in to comment.