Skip to content

chore: add coding guidelines rule#775

Merged
nicomiguelino merged 1 commit intomasterfrom
chore/add-coding-guidelines-rule
Apr 8, 2026
Merged

chore: add coding guidelines rule#775
nicomiguelino merged 1 commit intomasterfrom
chore/add-coding-guidelines-rule

Conversation

@nicomiguelino
Copy link
Copy Markdown
Contributor

@nicomiguelino nicomiguelino commented Apr 8, 2026

User description

Adds a new Claude rule file for general coding guidelines.

  • Early returns: handle edge cases first, then main logic
  • Flat code: minimize nesting via guard clauses and early exits

PR Type

Documentation


Description

  • Add shared coding guidelines document

    • Define Early Returns principle
    • Define Flat Code principle
  • Include good and avoid examples


Diagram Walkthrough

flowchart LR
  cg["Coding Guidelines"]
  er["Early Returns"]
  fc["Flat Code"]
  ex["JavaScript examples"]
  cg -- "includes" --> er
  cg -- "includes" --> fc
  er -- "illustrated by" --> ex
  fc -- "illustrated by" --> ex
Loading

File Walkthrough

Relevant files
Documentation
coding-guidelines.md
Add reusable coding guideline rule document                           

.claude/rules/coding-guidelines.md

  • Add new Coding Guidelines rule document
  • Describe early return patterns to reduce nesting
  • Describe flat code practices using guard clauses
  • Provide good versus avoid JavaScript examples
+67/-0   

- Add early returns guideline with examples
- Add flat code guideline with examples

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nicomiguelino nicomiguelino self-assigned this Apr 8, 2026
@nicomiguelino nicomiguelino requested a review from Copilot April 8, 2026 04:43
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

PR Reviewer Guide 🔍

(Review updated until commit 4628d8c)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@nicomiguelino nicomiguelino marked this pull request as ready for review April 8, 2026 04:44
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Persistent review updated to latest commit 4628d8c

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Claude rule file documenting general coding guidelines intended to apply across languages, focusing on reducing nesting and improving readability through guard clauses.

Changes:

  • Add an “Early Returns” guideline with good/avoid examples
  • Add a “Flat Code” guideline with good/avoid examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nicomiguelino nicomiguelino merged commit 7eb733f into master Apr 8, 2026
8 checks passed
@nicomiguelino nicomiguelino deleted the chore/add-coding-guidelines-rule branch April 8, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants