Skip to content

Add comprehensive style guidelines to STYLE.md#282

Open
oclivegriffin wants to merge 1 commit intomainfrom
admin/style-additions
Open

Add comprehensive style guidelines to STYLE.md#282
oclivegriffin wants to merge 1 commit intomainfrom
admin/style-additions

Conversation

@oclivegriffin
Copy link
Contributor

Description

Expand the STYLE.md code style guide with additional sections covering:

  • Pure functions and I/O handling patterns
  • Data structures (avoiding bare dicts for heterogeneous data)
  • Encoding invariants in types
  • Distinguishing None from empty collections
  • Function design and default argument guidelines
  • Code hygiene (deleting unused code, removing unnecessary logs)

Related Issue

N/A

Motivation and Context

The existing STYLE.md was fairly sparse. These additions document coding principles and conventions that help maintain code quality and consistency across the codebase. The guidelines emphasize safety, fail-fast behavior, and making invalid states unrepresentable through types.

How Has This Been Tested?

Documentation-only change - no testing required.

Does this PR introduce a breaking change?

No - this is a documentation update only.

🤖 Generated with Claude Code

Expand coding style guide with additional sections on:
- Pure functions and I/O handling
- Data structures (avoid bare dicts for heterogeneous data)
- Type invariants and encoding them in types
- Distinguishing None from empty collections
- Function design and default argument guidelines
- Code hygiene (deleting unused code, removing unnecessary logs)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@leesharkey
Copy link
Contributor

Lgtm. Some things that are included in https://github.com/goodfire-ai/spd/pull/275/files but not in your changes (which may be intentional but flagging in case not):

  • Explicit Error Types
  • Docstring Format
  • Type Checking (use basedpyright not mypy)

and some other things that probably aren't worth flagging.

@ocg-goodfire
Copy link
Collaborator

Sorry yea wasn't trying to be a replacement of your PR, just a quick PR to integrate my "SWE principles" snippet into this

@lee-goodfire
Copy link
Contributor

lee-goodfire commented Dec 9, 2025

Edit: Actually oops ignore this - I thought you were responding to another PR change.

Original: Lol no dw I was just pushing this because it was sitting in my unstaged files and wanted to clean things up. I have mostly parked this for the time being - use whatever you feel like!

@lee-goodfire
Copy link
Contributor

@ocg-goodfire The STYLE.md file was deleted in PR332 in favour of just putting style comments in the CLAUDE.md file. Up to you if you want to include these changes in the new CLAUDE.md or re-introduce the STYLE.md file.

@lee-goodfire
Copy link
Contributor

(This PR should probably be closed - will leave this up to @ocg-goodfire)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants