Skip to content

Add Code Style Principles section to CLAUDE.md#18713

Merged
harupy merged 2 commits intomlflow:masterfrom
harupy:refine-code-style-principles
Nov 6, 2025
Merged

Add Code Style Principles section to CLAUDE.md#18713
harupy merged 2 commits intomlflow:masterfrom
harupy:refine-code-style-principles

Conversation

@harupy
Copy link
Member

@harupy harupy commented Nov 6, 2025

What changes are proposed in this pull request?

This PR adds a new Code Style Principles section to CLAUDE.md to provide clear guidance for code contributions.

The new principles are:

  • Use top-level imports (only use lazy imports when necessary)
  • Only add docstrings in tests when they provide additional context
  • Only add code comments that explain non-obvious logic or provide additional context

These principles help maintain code quality by encouraging clean imports, meaningful documentation, and purposeful comments.

How is this PR tested?

  • Manual tests

This is a documentation-only change to CLAUDE.md guidance.

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section

Should this PR be included in the next patch release?

  • No (this PR will be included in the next minor release)

🤖 Generated with Claude Code

Updated the Code Style Principles section for better clarity and consistency:
- Changed "Import at top-level" to "Use top-level imports" for clearer action
- Replaced negative framing with positive framing for docstrings and comments
- All principles now consistently use "only" pattern to guide when to add code elements

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

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@github-actions github-actions bot added the rn/none List under Small Changes in Changelogs. label Nov 6, 2025
@harupy harupy requested a review from serena-ruan November 6, 2025 08:31
@github-actions github-actions bot added the v3.6.0 label Nov 6, 2025
Comment on lines +7 to +12
## Code Style Principles

- Use top-level imports (only use lazy imports when necessary)
- Only add test docstrings when they provide additional context
- Only add comments that explain non-obvious logic or provide additional context

Copy link
Member Author

@harupy harupy Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add this in dev/guides/python.md but I've never seen Claude Code read it

Copy link
Collaborator

@serena-ruan serena-ruan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@harupy harupy changed the title Refine code style principles in CLAUDE.md Add code style principles in CLAUDE.md Nov 6, 2025
@harupy harupy changed the title Add code style principles in CLAUDE.md Add Code Style Principles section to CLAUDE.md Nov 6, 2025
@harupy harupy merged commit 5a24882 into mlflow:master Nov 6, 2025
31 of 48 checks passed
@harupy harupy deleted the refine-code-style-principles branch November 6, 2025 16:14
@harupy harupy removed the v3.6.0 label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants