You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add comprehensive ruff configuration and fix code quality issues
- Add modern Python linting rules to pyproject.toml covering style, performance, and best practices
- Fix pre-commit config to use ruff-check instead of deprecated ruff alias
- Increase line length to 120 for better readability
- Fix nested if statements for better code clarity
- Break long system prompt into readable multi-line format
- Add missing docstrings to metrics methods
- Fix import sorting and organization
- Maintain API field camelCase compatibility with targeted ignores
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,3 +89,7 @@ Uses AWS Embedded Metrics for CloudWatch integration when deployed, with a no-op
89
89
## Code Style Guidelines
90
90
91
91
- Prefer using modern Python 3.9+ type syntax. Good: `a: list[str] | None`. Bad: `a: Optional[List[str]]`
92
+
93
+
## Development Workflow Notes
94
+
95
+
- The pre commit hooks may modify the code and so: always run them before `git add`, and if a commit hook fails then it's probably you'll need to `git add` again if it indicated if fixed issues (e.g. `ruff`)
# TODO: consider not baking the language and arch here for system prompt caching later on. We'll need to hit minimum token lengths.
184
-
system_prompt = f"""You are an expert in {arch} assembly code and {language}, helping users of the Compiler Explorer website understand how their code compiles to assembly.
185
-
The request will be in the form of a JSON document, which explains a source program and how it was compiled, and the resulting assembly code that was generated.
182
+
# TODO: consider not baking the language and arch here for system prompt caching later on.
183
+
# We'll need to hit minimum token lengths.
184
+
system_prompt = f"""You are an expert in {arch} assembly code and {language}, helping users of the
185
+
Compiler Explorer website understand how their code compiles to assembly.
186
+
The request will be in the form of a JSON document, which explains a source program and how it was compiled,
187
+
and the resulting assembly code that was generated.
186
188
Provide clear, concise explanations. Focus on key transformations, optimizations, and important assembly patterns.
187
189
Explanations should be educational and highlight why certain code constructs generate specific assembly instructions.
188
-
Give no commentary on the original source: it is expected the user already understands their input, and is only looking for guidance on the assembly output.
190
+
Give no commentary on the original source: it is expected the user already understands their input, and is only
191
+
looking for guidance on the assembly output.
189
192
If it makes it easiest to explain, note the corresponding parts of the source code, but do not focus on this.
190
193
Do not give an overall conclusion.
191
-
Be precise and accurate about CPU features and optimizations - avoid making incorrect claims about branch prediction or other hardware details."""
194
+
Be precise and accurate about CPU features and optimizations - avoid making incorrect claims about branch
195
+
prediction or other hardware details."""
192
196
193
197
# Call Claude API with JSON structure
194
198
LOGGER.info(f"Using Anthropic client with model: {MODEL}")
0 commit comments