Skip to content

Commit ea8fc59

Browse files
bzaczynskiclaude
andcommitted
Keep single quotes in run1_main.py to match the tutorial
The tutorial presents run1_main.py as the agent's flawed first-run output, and one of the flaws it calls out is the use of single-quoted strings. Ruff formatting had normalized them to double quotes, which contradicted the article. Restore the original single quotes and exclude this one file from Ruff, following the existing how-to-indent-in-python/sample_code.py precedent. Addresses @stephengruppetta's review comment on PR #781. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent a963d26 commit ea8fc59

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

agents-md/run1_main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
app = FastAPI()
77

8-
data_file = os.path.join(os.path.dirname(__file__), "cars.json")
8+
data_file = os.path.join(os.path.dirname(__file__), 'cars.json')
99
with open(data_file) as f:
1010
cars = json.load(f)
1111

@@ -27,15 +27,15 @@ def get_car(car_id: int) -> dict:
2727

2828
@app.post("/cars")
2929
def create_car(car: dict):
30-
car["id"] = len(cars) + 1
30+
car['id'] = len(cars) + 1
3131
cars.append(car)
32-
return {"message": "Car created successfully", "car": car}
32+
return {'message': 'Car created successfully', 'car': car}
3333

3434

3535
@app.delete("/cars/{car_id}")
3636
def delete_car(car_id: int):
3737
for i in range(len(cars)):
38-
if cars[i]["id"] == car_id:
38+
if cars[i]['id'] == car_id:
3939
cars.pop(i)
40-
return {"message": "Car deleted"}
41-
return {"error": "Car not found"}
40+
return {'message': 'Car deleted'}
41+
return {'error': 'Car not found'}

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ exclude = [
55
".devcontainers",
66
".github",
77
"migrations",
8-
"how-to-indent-in-python/sample_code.py"
8+
"how-to-indent-in-python/sample_code.py",
9+
"agents-md/run1_main.py"
910
]
1011

1112
[tool.ruff.lint]

0 commit comments

Comments
 (0)