Skip to content

Commit

Permalink
Merge pull request #936 from zariiii9003/ruff_pyflakes2
Browse files Browse the repository at this point in the history
Resolve undefined names
  • Loading branch information
danielhrisca authored Nov 6, 2023
2 parents 9590bea + 4425020 commit 4d8e700
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ repos:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: v0.1.1
rev: v0.1.2
hooks:
- id: ruff
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ select = [
]
ignore = [
"F401", # unused-import
"F821", # undefined-name
"F841", # unused-variable
]
exclude = ["./src/asammdf/gui/ui"]
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def compute_signal(

common_timebase = []
for signal in signals:
if isinstance(sig, (int, float)):
if isinstance(signal, (int, float)):
continue

if len(signal):
Expand Down
1 change: 1 addition & 0 deletions src/asammdf/gui/widgets/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def search_forward(self):
operator = self.op.currentText()

wildcard = f"{os.urandom(6).hex()}_WILDCARD_{os.urandom(6).hex()}"
text = self.pattern_match.text().strip()
pattern = text.replace("*", wildcard)
pattern = re.escape(pattern)
pattern = pattern.replace(wildcard, ".*")
Expand Down
2 changes: 2 additions & 0 deletions src/asammdf/gui/widgets/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@ def search_forward(self):

if self.match_type == "Wildcard":
wildcard = f"{os.urandom(6).hex()}_WILDCARD_{os.urandom(6).hex()}"
text = self.pattern_match.text().strip()
pattern = text.replace("*", wildcard)
pattern = re.escape(pattern)
pattern = pattern.replace(wildcard, ".*")
Expand Down Expand Up @@ -1507,6 +1508,7 @@ def search_backward(self):

if self.match_type == "Wildcard":
wildcard = f"{os.urandom(6).hex()}_WILDCARD_{os.urandom(6).hex()}"
text = self.pattern_match.text().strip()
pattern = text.replace("*", wildcard)
pattern = re.escape(pattern)
pattern = pattern.replace(wildcard, ".*")
Expand Down

0 comments on commit 4d8e700

Please sign in to comment.