Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
vrymar committed Oct 14, 2024
1 parent 0ef2c68 commit 360b994
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
8 changes: 5 additions & 3 deletions grafana_import/grafana.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,11 @@ def import_dashboard(self, dashboard: t.Dict[str, t.Any]) -> bool:
)
# ** case d) send a copy to existing dash : update existing
elif new_dash["folderId"] == old_dash["folderId"]:
if ("uid" not in new_dash["dashboard"]
or new_dash["dashboard"]["uid"] != old_dash["uid"]
or new_dash["dashboard"]["id"] != old_dash["id"]):
if (

Check warning on line 311 in grafana_import/grafana.py

View check run for this annotation

Codecov / codecov/patch

grafana_import/grafana.py#L311

Added line #L311 was not covered by tests
"uid" not in new_dash["dashboard"]
or new_dash["dashboard"]["uid"] != old_dash["uid"]
or new_dash["dashboard"]["id"] != old_dash["id"]
):
if self.overwrite:
if not self.keep_uid:
new_dash["dashboard"]["uid"] = old_dash["uid"]

Check warning on line 318 in grafana_import/grafana.py

View check run for this annotation

Codecov / codecov/patch

grafana_import/grafana.py#L317-L318

Added lines #L317 - L318 were not covered by tests
Expand Down
40 changes: 19 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,48 @@ line-length = 120
line-length = 120

lint.select = [
# Bandit
"S",
# Bugbear
"B",
# Builtins
"A",
# Bugbear
"B",
# comprehensions
"C4",
# Pycodestyle
"E",
# eradicate
"ERA",
# flake8-2020
"YTT",
# Pyflakes
"F",
# isort
"I",
# pandas-vet
"PD",
# return
"RET",
# Bandit
"S",
# print
"T20",
# Pycodestyle
"E",
"W",
# Pyflakes
"F",
# return
"RET",
# flake8-2020
"YTT",
]

lint.extend-ignore = [
]

[tool.ruff.lint.per-file-ignores]
"tests/*" = [
# Use of `assert` detected
"S101",
]
"grafana_import/cli.py" = [
lint.per-file-ignores."grafana_import/cli.py" = [
# `print` found
"T201",
]


# ===================
# Tasks configuration
# ===================
lint.per-file-ignores."tests/*" = [
# Use of `assert` detected
"S101",
]

[tool.pytest.ini_options]
addopts = "-rA --verbosity=3 --cov --cov-report=term-missing --cov-report=xml"
Expand All @@ -69,14 +67,14 @@ branch = false
omit = [
"tests/*",
]
source = ["grafana_import"]
source = [ "grafana_import" ]

[tool.coverage.report]
fail_under = 0
show_missing = true

[tool.mypy]
packages = ["grafana_import"]
packages = [ "grafana_import" ]
install_types = true
ignore_missing_imports = true
implicit_optional = true
Expand Down

0 comments on commit 360b994

Please sign in to comment.