Skip to content

Commit ab4b669

Browse files
committed
Ruff
1 parent 236b225 commit ab4b669

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

scripts/ruff_check_format_assets.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ find src tests scripts -name "*.py" -print0 | xargs -0 python3 scripts/custom_fo
2828

2929
# Show remaining issues (mainly line length issues that need manual intervention)
3030
echo -e "\n\nRemaining issues that need manual attention:"
31-
ruff check src tests scripts --select E501 --statistics
31+
ruff check src tests scripts --select E501
3232

3333
echo "Linting/formatting complete! All auto-fixable issues have been resolved."
3434
echo "Manually review and fix any remaining line length issues if desired."

src/models/blockchain_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ def _get_next_rpc_provider(self) -> None:
142142
logger.warning(warning_message)
143143

144144
if self.slack_notifier:
145-
self.slack_notifier.send_info_notification(
146-
message=warning_message, title="RPC Provider Rotation"
147-
)
145+
self.slack_notifier.send_info_notification(message=warning_message, title="RPC Provider Rotation")
148146

149147
self._connect_to_rpc()
150148

src/utils/configuration.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,30 +141,44 @@ def to_int(v):
141141
"MIN_ONLINE_DAYS": to_int(substituted_config.get("eligibility_criteria", {}).get("MIN_ONLINE_DAYS")),
142142
"MIN_SUBGRAPHS": to_int(substituted_config.get("eligibility_criteria", {}).get("MIN_SUBGRAPHS")),
143143
"MAX_LATENCY_MS": to_int(substituted_config.get("eligibility_criteria", {}).get("MAX_LATENCY_MS")),
144-
"MAX_BLOCKS_BEHIND": to_int(substituted_config.get("eligibility_criteria", {}).get("MAX_BLOCKS_BEHIND")),
144+
"MAX_BLOCKS_BEHIND": to_int(
145+
substituted_config.get("eligibility_criteria", {}).get("MAX_BLOCKS_BEHIND")
146+
),
145147

146148
# Blockchain settings
147-
"BLOCKCHAIN_CONTRACT_ADDRESS": substituted_config.get("blockchain", {}).get("BLOCKCHAIN_CONTRACT_ADDRESS"),
149+
"BLOCKCHAIN_CONTRACT_ADDRESS": substituted_config.get("blockchain", {}).get(
150+
"BLOCKCHAIN_CONTRACT_ADDRESS"
151+
),
148152
"BLOCKCHAIN_FUNCTION_NAME": substituted_config.get("blockchain", {}).get("BLOCKCHAIN_FUNCTION_NAME"),
149153
"BLOCKCHAIN_CHAIN_ID": to_int(substituted_config.get("blockchain", {}).get("BLOCKCHAIN_CHAIN_ID")),
150-
"BLOCKCHAIN_RPC_URLS": self._parse_rpc_urls(substituted_config.get("blockchain", {}).get("BLOCKCHAIN_RPC_URLS")),
154+
"BLOCKCHAIN_RPC_URLS": self._parse_rpc_urls(
155+
substituted_config.get("blockchain", {}).get("BLOCKCHAIN_RPC_URLS")
156+
),
151157
"BLOCK_EXPLORER_URL": substituted_config.get("blockchain", {}).get("BLOCK_EXPLORER_URL"),
152158
"TX_TIMEOUT_SECONDS": to_int(substituted_config.get("blockchain", {}).get("TX_TIMEOUT_SECONDS")),
153159

154160
# Scheduling
155161
"SCHEDULED_RUN_TIME": substituted_config.get("scheduling", {}).get("SCHEDULED_RUN_TIME"),
156162

157163
# Subgraph URLs
158-
"SUBGRAPH_URL_PRE_PRODUCTION": substituted_config.get("subgraph", {}).get("SUBGRAPH_URL_PRE_PRODUCTION"),
164+
"SUBGRAPH_URL_PRE_PRODUCTION": substituted_config.get("subgraph", {}).get(
165+
"SUBGRAPH_URL_PRE_PRODUCTION"
166+
),
159167
"SUBGRAPH_URL_PRODUCTION": substituted_config.get("subgraph", {}).get("SUBGRAPH_URL_PRODUCTION"),
160168

161169
# Processing settings
162170
"BATCH_SIZE": to_int(substituted_config.get("processing", {}).get("BATCH_SIZE")),
163-
"MAX_AGE_BEFORE_DELETION": to_int(substituted_config.get("processing", {}).get("MAX_AGE_BEFORE_DELETION")),
164-
"BIGQUERY_ANALYSIS_PERIOD_DAYS": to_int(substituted_config.get("processing", {}).get("BIGQUERY_ANALYSIS_PERIOD_DAYS")),
171+
"MAX_AGE_BEFORE_DELETION": to_int(
172+
substituted_config.get("processing", {}).get("MAX_AGE_BEFORE_DELETION")
173+
),
174+
"BIGQUERY_ANALYSIS_PERIOD_DAYS": to_int(
175+
substituted_config.get("processing", {}).get("BIGQUERY_ANALYSIS_PERIOD_DAYS")
176+
),
165177

166178
# Secrets
167-
"GOOGLE_APPLICATION_CREDENTIALS": substituted_config.get("secrets", {}).get("GOOGLE_APPLICATION_CREDENTIALS"),
179+
"GOOGLE_APPLICATION_CREDENTIALS": substituted_config.get("secrets", {}).get(
180+
"GOOGLE_APPLICATION_CREDENTIALS"
181+
),
168182
"PRIVATE_KEY": substituted_config.get("secrets", {}).get("BLOCKCHAIN_PRIVATE_KEY"),
169183
"STUDIO_API_KEY": substituted_config.get("secrets", {}).get("STUDIO_API_KEY"),
170184
"STUDIO_DEPLOY_KEY": substituted_config.get("secrets", {}).get("STUDIO_DEPLOY_KEY"),
@@ -255,7 +269,8 @@ def _validate_config(config: dict[str, Any]) -> dict[str, Any]:
255269
missing = [field for field in required if not config.get(field)]
256270
if missing:
257271
raise ConfigurationError(
258-
f"Missing required configuration fields in config.toml or environment variables: {', '.join(sorted(missing))}"
272+
"Missing required configuration fields in config.toml or environment variables:",
273+
f"{', '.join(sorted(missing))}",
259274
)
260275

261276
# Validate specific field formats

0 commit comments

Comments
 (0)