Skip to content

Commit

Permalink
lint(track_config): change average_run_time from float to int (#765)
Browse files Browse the repository at this point in the history
Having the average run time as a float gives the impression of being
exact, whereas the actual run time wildly varies due to a wide variety
of reasons.

A second downside is that `jq`, which is often used to work with
track config files, will remove any trailing `.0` from a number,
which caused linting to fail.
  • Loading branch information
ErikSchierboom authored Jul 14, 2023
1 parent 34ff7d5 commit d2e04a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lint/track_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ proc hasValidTestRunner(data: JsonNode; path: Path): bool =
# Only check the `test_runner` object if `status.test_runner` is `true`.
if data[s][k].getBool():
if hasObject(data, k, path):
result = hasFloat(data[k], "average_run_time", path, k,
requirePositive = true, decimalPlaces = 1)
result = hasInteger(data[k], "average_run_time", path, k,
allowed = 1..20)
else:
result = true

Expand Down

0 comments on commit d2e04a5

Please sign in to comment.