Skip to content

Commit 118767e

Browse files
committed
fix: resolve ruff linting errors in validation.py
- SIM103: Return condition directly instead of if/return True - SIM102: Combine nested if statements with 'and'
1 parent 361826a commit 118767e

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

src/github_analyzer/config/validation.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,7 @@ def validate_jira_url(url: str) -> bool:
386386
return False
387387

388388
# Check for dangerous characters
389-
if _contains_dangerous_chars(url):
390-
return False
391-
392-
return True
389+
return not _contains_dangerous_chars(url)
393390
except Exception:
394391
return False
395392

@@ -477,10 +474,8 @@ def validate_iso8601_date(date_str: str) -> bool:
477474
return False
478475
if not (1 <= day <= 31):
479476
return False
480-
if year < 1900 or year > 2100:
481-
return False
482477

483-
return True
478+
return not (year < 1900 or year > 2100)
484479
except (ValueError, IndexError):
485480
return False
486481

@@ -522,9 +517,8 @@ def load_jira_projects(filepath: str | Path) -> list[str]:
522517
continue
523518

524519
# Validate project key format
525-
if validate_project_key(line):
526-
if line not in seen:
527-
seen.add(line)
528-
projects.append(line)
520+
if validate_project_key(line) and line not in seen:
521+
seen.add(line)
522+
projects.append(line)
529523

530524
return projects

0 commit comments

Comments
 (0)