Skip to content

Commit

Permalink
chore: Appease new pylint version
Browse files Browse the repository at this point in the history
Signed-off-by: Will Murphy <[email protected]>
  • Loading branch information
willmurphyscode committed Sep 15, 2023
1 parent 57427df commit e37e2ca
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 16 deletions.
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ line_length = 100

[tool.pylint.messages_control]
disable = [
# pylint sometimes complains about black's formatting; we go with black
"bad-continuation",
"C0330",
"C0326",

# pylint wants deferred formatting for log messages (to use less CPU if that log level is disabled). We prefer the legibility of f-strings: f"a is {a}"
"logging-format-interpolation",
"logging-fstring-interpolation",
Expand Down
2 changes: 1 addition & 1 deletion src/yardstick/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class LabelEntryCollection:
def __init__(self, entries: List[LabelEntry]):
self.entries = entries

@functools.cache
@functools.cache # pylint: disable=method-cache-max-size-none
def for_image(self, image: str) -> List[LabelEntry]:
return [e for e in self.entries if e.matches_image(image)]

Expand Down
2 changes: 1 addition & 1 deletion src/yardstick/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run_scan(

# some tools will have additional metadata... persist this on the config
if hasattr(tool, "version_detail"):
installed_version = tool.__getattribute__("version_detail")
installed_version = getattr(tool, "version_detail")
if installed_version != config.tool_version:
config.detail["version_detail"] = installed_version
config.tool_version = installed_version
Expand Down
6 changes: 3 additions & 3 deletions src/yardstick/cli/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def summarize_across_images(title, description, source, context_source=None):
if lower == -1 or upper == -1:
f1_score = "error!"
else:
f1_score = color(f"Impractical ({lower:0.2f}-{upper:0.2f})", fore=("red"))
f1_score = color(f"Impractical ({lower:0.2f}-{upper:0.2f})", fore="red")
else:
f1_score = ""
row.append(f1_score)
Expand Down Expand Up @@ -371,8 +371,8 @@ def labels_by_ecosystem_comparison(
]
all_rows.append(row)

tps = sum([stats.tps_by_tool_by_ecosystem[tool][e] for e in stats.ecosystems])
fps = sum([stats.fps_by_tool_by_ecosystem[tool][e] for e in stats.ecosystems])
tps = sum([stats.tps_by_tool_by_ecosystem[tool][e] for e in stats.ecosystems]) # pylint: disable=consider-using-generator
fps = sum([stats.fps_by_tool_by_ecosystem[tool][e] for e in stats.ecosystems]) # pylint: disable=consider-using-generator
d = tps + fps
precision = 0.0
if d:
Expand Down
10 changes: 5 additions & 5 deletions src/yardstick/cli/explore/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ def run(result: artifact.ScanResult):
completer = ResultCompleter(matches)
all_completers = merge_completers((completer, executor))
vaidator = ExploreValidator(all_completers, matches)
config = dict(
bottom_toolbar=bottom_toolbar(result),
config = {
"bottom_toolbar": bottom_toolbar(result),
# mouse_support=True, # with mouse support, scrolling is disabled
completer=all_completers,
validator=vaidator,
)
"completer": all_completers,
"validator": vaidator,
}
session: PromptSession = PromptSession()

executor.help()
Expand Down
2 changes: 1 addition & 1 deletion src/yardstick/store/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ def get() -> StoreConfig:

def set_values(**kwargs):
for k, v in kwargs.items():
get().__setattr__(k, v)
setattr(get(), k, v)
1 change: 1 addition & 0 deletions src/yardstick/utils/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def get_latest_release_version(project: str, owner: str = "anchore") -> str:
response = requests.get(
f"https://api.github.com/repos/{owner}/{project}/releases/latest",
headers=headers,
timeout=15.0,
)

if response.status_code >= 400:
Expand Down

0 comments on commit e37e2ca

Please sign in to comment.