Skip to content

Commit 96a91d9

Browse files
committed
run formatting/linting on test library as well
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
1 parent e661605 commit 96a91d9

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

tests/RobotFramework/tasks.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,7 @@ def is_ci():
138138
return bool(os.getenv("CI"))
139139

140140

141-
@task
142-
def lint(c):
143-
"""Run linter"""
144-
c.run(f"{sys.executable} -m pylint libraries")
145-
146-
@task
141+
@task(aliases=["lint"])
147142
def lint_tests(c, threshold="W"):
148143
"""Run RobotFramework Test Linter and Formatter check
149144
@@ -154,18 +149,20 @@ def lint_tests(c, threshold="W"):
154149
print("Checking formatting of RobotFramework tests...", file=sys.stderr)
155150
c.run(f"{sys.executable} -m robocop check --threshold {threshold}")
156151

157-
@task(name="format")
158-
def formatcode(c):
159-
"""Format python code"""
160-
c.run(f"{sys.executable} -m black libraries")
152+
print("Checking linting of RobotFramework libraries...", file=sys.stderr)
153+
c.run(f"{sys.executable} -m pylint libraries")
161154

162-
@task
155+
156+
@task(aliases=["format"])
163157
def format_tests(c):
164-
"""Format RobotFramework tests
165-
"""
158+
"""Format RobotFramework tests"""
166159
print("Formatting of RobotFramework tests...", file=sys.stderr)
167160
c.run(f"{sys.executable} -m robocop format")
168161

162+
print("Formatting of RobotFramework libraries...", file=sys.stderr)
163+
c.run(f"{sys.executable} -m black .")
164+
165+
169166
@task(name="reports")
170167
def start_server(c, port=9000):
171168
"""Start simple webserver used to display the test reports"""
@@ -281,7 +278,13 @@ def use_local(c, arch="", package_type="deb"):
281278
},
282279
)
283280
def build(
284-
c, name="debian-systemd", cache=True, local=True, binary=None, arch="", build_options=""
281+
c,
282+
name="debian-systemd",
283+
cache=True,
284+
local=True,
285+
binary=None,
286+
arch="",
287+
build_options="",
285288
):
286289
"""Build the container integration test image
287290

0 commit comments

Comments
 (0)