Skip to content

Commit 57dd8b5

Browse files
committed
Fix whitespace and style issues in conftest.py and validate_workflow.py
1 parent 4bed25f commit 57dd8b5

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def pytest_configure(config):
2020
"markers",
2121
"regression: marks tests as regression tests"
2222
)
23-
23+
2424
# Create reports directory if it doesn't exist
2525
import os
2626
os.makedirs("reports", exist_ok=True)

validate_workflow.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
import sys
55
import os
66

7+
78
def validate_workflow():
89
workflow_file = ".github/workflows/ci.yml"
9-
10+
1011
if not os.path.exists(workflow_file):
1112
print(f"❌ Workflow file not found: {workflow_file}")
1213
return False
13-
14+
1415
try:
1516
with open(workflow_file, 'r') as file:
1617
workflow = yaml.safe_load(file)
17-
18+
1819
print("✅ YAML syntax is valid")
1920
print(f"📋 Workflow name: {workflow.get('name', 'Unknown')}")
2021
print(f"🔧 Number of jobs: {len(workflow.get('jobs', {}))}")
21-
22+
2223
# Check required sections
2324
required_sections = ['on', 'jobs']
2425
for section in required_sections:
@@ -27,28 +28,28 @@ def validate_workflow():
2728
else:
2829
print(f"❌ Required section '{section}' missing")
2930
return False
30-
31+
3132
# Check jobs structure
3233
jobs = workflow.get('jobs', {})
3334
job_names = list(jobs.keys())
3435
print(f"🏗️ Jobs found: {', '.join(job_names)}")
35-
36+
3637
for job_name, job_config in jobs.items():
3738
if 'runs-on' not in job_config:
3839
print(f"❌ Missing 'runs-on' for job: {job_name}")
3940
return False
40-
41+
4142
# Check for environment variables
4243
if 'env' in workflow:
4344
print(f"🌍 Environment variables: {list(workflow['env'].keys())}")
44-
45+
4546
# Check permissions
4647
if 'permissions' in workflow:
4748
print(f"🔐 Permissions configured: {list(workflow['permissions'].keys())}")
48-
49+
4950
print("\n🎉 Workflow validation passed!")
5051
return True
51-
52+
5253
except yaml.YAMLError as e:
5354
print(f"❌ YAML syntax error: {e}")
5455
return False

0 commit comments

Comments
 (0)