Skip to content

Commit

Permalink
fix(docs/update_readme.py,pyproject.toml-,+7): fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
violetbrina committed Dec 18, 2024
1 parent d3f6b6b commit 97acdb8
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 201 deletions.
10 changes: 5 additions & 5 deletions docs/update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def load_descriptions(description_file):
with open(description_file, 'r') as f:
with open(description_file) as f:
descriptions = yaml.safe_load(f)
return descriptions

Expand All @@ -22,7 +22,7 @@ def parse_workflows(directory, description_file):
for filename in os.listdir(directory):
if filename.endswith('.yaml') or filename.endswith('.yml'):
filepath = os.path.join(directory, filename)
with open(filepath, 'r') as file:
with open(filepath) as file:
try:
data = yaml.load(file, Loader=yaml.BaseLoader)
workflow_name = data.get('name', 'Unnamed Workflow')
Expand Down Expand Up @@ -57,9 +57,9 @@ def parse_triggers(on_field):
else:
triggers.append(f'`{trigger}`')
return ' and '.join(triggers)
elif isinstance(on_field, list): # Handle `on: [event1, event2]`
if isinstance(on_field, list): # Handle `on: [event1, event2]`
return ', '.join([f'`{event}`' for event in on_field])
elif isinstance(on_field, str): # Handle `on: event`
if isinstance(on_field, str): # Handle `on: event`
return f'`{on_field}`'
return '`manual`' # Default if `on` is missing

Expand All @@ -77,7 +77,7 @@ def generate_markdown(workflows):


def update_readme(markdown, readme_file):
with open(readme_file, 'r') as file:
with open(readme_file) as file:
content = file.read()

start_marker = '### 🎢 Workflows'
Expand Down
223 changes: 108 additions & 115 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies = [
"grpcio-status>=1.48,<1.50",
"metamist>=6.9.0",
"networkx>=3.4.2",
"coloredlogs>=15.0.1",
]
classifiers = [
"Development Status :: 3 - Alpha",
Expand Down Expand Up @@ -144,146 +143,140 @@ fixable = [
]

ignore = [
"A001",
"A002",
"ANN001",
"ANN002",
"ANN003",
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN201", # Missing return type annotation for public function
"ANN202",
"ANN204", # Missing type annotation for special method `__init__`
"ANN205",
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"ARG005",
"B006",
"B007",
"B008",
"B023",
"B904",
"BLE001",
"C400",
"C401",
"C403",
"C405",
"C408",
"C416",
"C417",
"C419",
"C901",
"COM819",
"DTZ002",
"DTZ005",
"DTZ011",
"E401",
"E402",
"E501", # Line length too long
"E712",
"E713",
"E731", # Do not assign a lambda expression, use a def
"E741", # Ambiguous variable name
"G004", # Logging statement uses f-string
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLW0603", # Using the global statement to update `<VAR>` is discouraged
"PT018", # Assertion should be broken down into multiple parts
"Q000", # Single quotes found but double quotes preferred
"S101", # Use of assert detected
"SLF001", # Private member accessed: `_preemptible`

"ARG001", # Unused function argument
"ARG002", # Unused method argument

"PLR2004", # Magic value used

"ANN001",
"ANN202",
"C408",
"TID252",
"RET504",
"ERA001",
"UP032",
"RUF100",
"ISC001",
"PIE804",
"F401",
"C901",
"W605",
"RET505",
"ANN003",
"RUF013",
"UP031",
"RUF010",
"B006",
"ANN002",
"B023",
"ERA001", # Found commented-out code
"EXE001",
"F401",
"F403",
"F821",
"F841",
"G001",
"SIM108",
"RUF005",
"G002",
"PD901",
"N999",
"SIM118",
"SIM102",
"PLW2901",
"S603",
"ARG005",
"PGH003",
"B904",
"N802",
"G003",
"G004", # Logging statement uses f-string
"ISC001",
"ISC002",
"ISC003",
"ANN205",
"S607",
"RUF015",
"E701",
"N818",
"PIE790",
"N802",
"N803",
"A002",
"RUF012",
"W291",
"S113",
"S311",
"N805",
"N806",
"PLR5501",
"F403",
"SIM115",
"B007",
"F841",
"C405",
"C419",
"SIM300",
"N818",
"N999",
"PD003",
"PD010",
"PD011",
"UP015",
"S602",
"Q002",
"ISC002",
"COM819",
"C416",
"DTZ005",
"G003",
"S608",
"PD901",
"PGH003",
"PIE790",
"PIE804",
"PIE808",
"B008",
"S108",
"E402",
"S605",
"F821",
"RET507",
"RET503",
"UP030",
"UP026",
"PLR1714",
"C403",
"PLR1711",
"PIE810",
"DTZ011",
"S105",
"BLE001",
"C401",
"C400",
"PLR0402",
"SIM201",
"RET506",
"C417",
"PD010",
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR1711",
"PLR1714",
"PLR2004", # Magic value used
"PLR5501",
"PLW0603", # Using the global statement to update `<VAR>` is discouraged
"PLW1510",
"A001",
"W292",
"PYI024",
"PLW2901",
"Q000", # Single quotes found but double quotes preferred
"Q001",
"Q002",
"Q003",
"S301",
"RET501",
"PD003",
"SIM117",
"RET503",
"RET504",
"RET505",
"RET506",
"RET507",
"RUF002",
"UP027",
"SIM105",
"E713",
"S324",
"RUF005",
"RUF010",
"RUF012",
"RUF013",
"RUF015",
"RUF100",
"S101", # Use of assert detected
"S105",
"S108",
"S113",
"S301",
"S310",
"Q001",
"UP020",
"S311",
"S324",
"S506",
"N805",
"E712",
"E401",
"S602",
"S603",
"S605",
"S607",
"S608",
"SIM102",
"SIM105",
"SIM108",
"SIM115",
"SIM117",
"SIM118",
"SIM201",
"SIM212",
"DTZ002",
"SIM300",
"SLF001", # Private member accessed: `_preemptible`
"TID252",
"UP007",
"UP015",
"UP020",
"UP026",
"UP027",
"UP030",
"UP031",
"UP032",
"W291",
"W292",
"W605",
]

[tool.ruff.lint.isort]
Expand Down
1 change: 0 additions & 1 deletion src/cpg_flow/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def _populate_alignment_inputs(
f'No reads found for sequencing group {sequencing_group.id} of type {entry["type"]}',
)

return None


def _populate_analysis(dataset: Dataset) -> None:
Expand Down
Loading

0 comments on commit 97acdb8

Please sign in to comment.