Skip to content

Commit 40d6c75

Browse files
authored
chore: format things with prettier (#34)
1 parent 764e935 commit 40d6c75

File tree

4 files changed

+98
-53
lines changed

4 files changed

+98
-53
lines changed

.claude/commands/update-changelog.md

Lines changed: 65 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Update Changelog
22

3-
You are helping to add an entry to the CHANGELOG.md file for the PackageJson project.
3+
You are helping to add an entry to the CHANGELOG.md file for the PackageJson
4+
project.
45

56
## Critical Requirements
67

7-
1. **User-visible changes only**: Only add changelog entries for user-visible changes:
8-
8+
1. **User-visible changes only**: Only add changelog entries for user-visible
9+
changes:
910
- New features
1011
- Bug fixes
1112
- Breaking changes
@@ -29,25 +30,33 @@ You are helping to add an entry to the CHANGELOG.md file for the PackageJson pro
2930
Each changelog entry MUST follow this exact format:
3031

3132
```markdown
32-
- **Bold description of change**. [PR 1818](https://github.com/shakacode/package_json/pull/1818) by [username](https://github.com/username). Optional additional context or details.
33+
- **Bold description of change**.
34+
[PR 1818](https://github.com/shakacode/package_json/pull/1818) by
35+
[username](https://github.com/username). Optional additional context or
36+
details.
3337
```
3438

3539
**Important formatting rules**:
3640

3741
- Start with a dash and space: `- `
3842
- Use **bold** for the main description
3943
- End the bold description with a period before the link
40-
- Always link to the PR: `[PR 1818](https://github.com/shakacode/package_json/pull/1818)` - **NO hash symbol**
44+
- Always link to the PR:
45+
`[PR 1818](https://github.com/shakacode/package_json/pull/1818)` - **NO hash
46+
symbol**
4147
- Always link to the author: `by [username](https://github.com/username)`
4248
- End with a period after the author link
43-
- Additional details can be added after the main entry, using proper indentation for multi-line entries
49+
- Additional details can be added after the main entry, using proper indentation
50+
for multi-line entries
4451

4552
### Breaking Changes Format
4653

4754
For breaking changes, use this format:
4855

4956
```markdown
50-
- **Feature Name**: Description of the breaking change. See migration guide below. [PR 1818](https://github.com/shakacode/package_json/pull/1818) by [username](https://github.com/username).
57+
- **Feature Name**: Description of the breaking change. See migration guide
58+
below. [PR 1818](https://github.com/shakacode/package_json/pull/1818) by
59+
[username](https://github.com/username).
5160

5261
**Migration Guide:**
5362

@@ -57,7 +66,8 @@ For breaking changes, use this format:
5766

5867
### Category Organization
5968

60-
Entries should be organized under these section headings. The project uses both standard and custom headings:
69+
Entries should be organized under these section headings. The project uses both
70+
standard and custom headings:
6171

6272
**Standard headings** (from keepachangelog.com) - use these for most changes:
6373

@@ -69,12 +79,14 @@ Entries should be organized under these section headings. The project uses both
6979
- `#### Security` - Security-related changes
7080
- `#### Improved` - Improvements to existing features
7181

72-
**Custom headings** (project-specific) - use sparingly when standard headings don't fit:
82+
**Custom headings** (project-specific) - use sparingly when standard headings
83+
don't fit:
7384

7485
- `#### Breaking Changes` - Breaking changes with migration guides
7586
- `#### Performance` - Performance improvements
7687

77-
**Prefer standard headings.** Only use custom headings when the change needs more specific categorization.
88+
**Prefer standard headings.** Only use custom headings when the change needs
89+
more specific categorization.
7890

7991
**Only include section headings that have entries.**
8092

@@ -96,41 +108,49 @@ This will:
96108
### For Regular Changelog Updates
97109

98110
1. **Determine the correct version tag to compare against**:
99-
100-
- First, check the tag dates: `git log --tags --simplify-by-decoration --pretty="format:%ai %d" | head -10`
111+
- First, check the tag dates:
112+
`git log --tags --simplify-by-decoration --pretty="format:%ai %d" | head -10`
101113
- Find the latest version tag and its date
102114
- Compare main branch date to the tag date
103-
- If the tag is NEWER than main, it means main needs to be updated to include the tag's commits
104-
- **CRITICAL**: Always use `git log TAG..BRANCH` to find commits that are in the tag but not in the branch, as the tag may be ahead
115+
- If the tag is NEWER than main, it means main needs to be updated to include
116+
the tag's commits
117+
- **CRITICAL**: Always use `git log TAG..BRANCH` to find commits that are in
118+
the tag but not in the branch, as the tag may be ahead
105119

106120
2. **Check commits and version boundaries**:
107-
108-
- Run `git log --oneline LAST_TAG..main` to see commits since the last release
109-
- Also check `git log --oneline main..LAST_TAG` to see if the tag is ahead of main
110-
- If the tag is ahead, entries in "Unreleased" section may actually belong to that tagged version
121+
- Run `git log --oneline LAST_TAG..main` to see commits since the last
122+
release
123+
- Also check `git log --oneline main..LAST_TAG` to see if the tag is ahead of
124+
main
125+
- If the tag is ahead, entries in "Unreleased" section may actually belong to
126+
that tagged version
111127
- Identify which commits contain user-visible changes
112128
- Extract PR numbers and author information from commit messages
113129
- **Never ask the user for PR details** - get them from the git history
114130

115-
3. **Validate** that changes are user-visible (per the criteria above). If not user-visible, skip those commits.
131+
3. **Validate** that changes are user-visible (per the criteria above). If not
132+
user-visible, skip those commits.
116133

117-
4. **Read the current CHANGELOG.md** to understand the existing structure and formatting.
134+
4. **Read the current CHANGELOG.md** to understand the existing structure and
135+
formatting.
118136

119137
5. **Determine where entries should go**:
120-
121-
- If the latest version tag is NEWER than main branch, move entries from "Unreleased" to that version section
138+
- If the latest version tag is NEWER than main branch, move entries from
139+
"Unreleased" to that version section
122140
- If main is ahead of the latest tag, add new entries to "Unreleased"
123141
- Always verify the version date in CHANGELOG.md matches the actual tag date
124142

125-
6. **Add or move entries** to the appropriate section under appropriate category headings.
126-
127-
- **CRITICAL**: When moving entries from "Unreleased" to a version section, merge them with existing entries under the same category heading
128-
- **NEVER create duplicate section headings** (e.g., don't create two "### Fixed" sections)
129-
- If the version section already has a category heading (e.g., "### Fixed"), add the moved entries to that existing section
143+
6. **Add or move entries** to the appropriate section under appropriate category
144+
headings.
145+
- **CRITICAL**: When moving entries from "Unreleased" to a version section,
146+
merge them with existing entries under the same category heading
147+
- **NEVER create duplicate section headings** (e.g., don't create two "###
148+
Fixed" sections)
149+
- If the version section already has a category heading (e.g., "### Fixed"),
150+
add the moved entries to that existing section
130151
- Maintain the category order as defined above
131152

132153
7. **Verify formatting**:
133-
134154
- Bold description with period
135155
- Proper PR link (NO hash symbol)
136156
- Proper author link
@@ -151,13 +171,13 @@ This will:
151171
When releasing from beta to a stable version (e.g., v1.1.0-beta.3 → v1.1.0):
152172

153173
1. **Remove all beta version labels** from the changelog:
154-
155-
- Change `### [v1.1.0-beta.1]`, `### [v1.1.0-beta.2]`, etc. to a single `### [v1.1.0]` section
174+
- Change `### [v1.1.0-beta.1]`, `### [v1.1.0-beta.2]`, etc. to a single
175+
`### [v1.1.0]` section
156176
- Combine all beta entries into the stable release section
157177

158178
2. **Consolidate duplicate entries**:
159-
160-
- If bug fixes or changes were made to features introduced in earlier betas, keep only the final state
179+
- If bug fixes or changes were made to features introduced in earlier betas,
180+
keep only the final state
161181
- Remove redundant changelog entries for fixes to beta features
162182
- Keep the most recent/accurate description of each change
163183

@@ -191,21 +211,29 @@ grep -A 3 "^#### " CHANGELOG.md | head -30
191211
### Good Entry Example
192212

193213
```markdown
194-
- **New feature description**: Added helpful functionality that users will appreciate. [PR 123](https://github.com/shakacode/package_json/pull/123) by [username](https://github.com/username).
214+
- **New feature description**: Added helpful functionality that users will
215+
appreciate. [PR 123](https://github.com/shakacode/package_json/pull/123) by
216+
[username](https://github.com/username).
195217
```
196218

197219
### Entry with Sub-bullets Example
198220

199221
```markdown
200-
- **Multi-part feature**: Added new configuration options for enhanced functionality:
201-
- `option_name`: Description of the option and its purpose. [PR 123](https://github.com/shakacode/package_json/pull/123) by [username](https://github.com/username)
202-
- `another_option`: Description of another option. [PR 124](https://github.com/shakacode/package_json/pull/124) by [username](https://github.com/username)
222+
- **Multi-part feature**: Added new configuration options for enhanced
223+
functionality:
224+
- `option_name`: Description of the option and its purpose.
225+
[PR 123](https://github.com/shakacode/package_json/pull/123) by
226+
[username](https://github.com/username)
227+
- `another_option`: Description of another option.
228+
[PR 124](https://github.com/shakacode/package_json/pull/124) by
229+
[username](https://github.com/username)
203230
```
204231

205232
### Breaking Change Example
206233

207234
```markdown
208-
- **Method Removal**: Several deprecated methods have been removed. If you're using any of the following methods, you'll need to migrate:
235+
- **Method Removal**: Several deprecated methods have been removed. If you're
236+
using any of the following methods, you'll need to migrate:
209237
- `old_method_one()`
210238
- `old_method_two()`
211239

.github/workflows/claude-code-review.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,7 @@ jobs:
5353
5454
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5555
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
56-
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
57-
56+
claude_args:
57+
'--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh
58+
issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr
59+
view:*),Bash(gh pr list:*)"'

.github/workflows/claude.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ jobs:
4747
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4848
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
4949
# claude_args: '--allowed-tools Bash(gh pr:*)'
50-

CLAUDE.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
This file provides guidance to Claude Code (claude.ai/code) when working with
4+
code in this repository.
45

56
## ⚠️ CRITICAL REQUIREMENTS
67

@@ -21,28 +22,39 @@ These requirements are non-negotiable. CI will fail if not followed.
2122
- **Linting** (MANDATORY BEFORE EVERY COMMIT):
2223
- **REQUIRED**: `bundle exec rubocop` - Must pass with zero offenses
2324
- Auto-fix RuboCop violations: `bundle exec rubocop -a`
24-
- **⚠️ MANDATORY BEFORE GIT PUSH**: `bundle exec rubocop` and fix ALL violations + ensure trailing newlines
25+
- **⚠️ MANDATORY BEFORE GIT PUSH**: `bundle exec rubocop` and fix ALL
26+
violations + ensure trailing newlines
2527
- **Default task** (runs tests and rubocop): `rake`
2628

2729
## Changelog
2830

29-
- **Update CHANGELOG.md for user-visible changes only** (features, bug fixes, breaking changes, deprecations, performance improvements)
30-
- **Do NOT add entries for**: linting, formatting, refactoring, tests, or documentation fixes
31-
- **Format**: `[PR 123](https://github.com/shakacode/package_json/pull/123) by [username](https://github.com/username)` (no hash in PR number)
32-
- **Use `/update-changelog` command** for guided changelog updates with automatic formatting
33-
- **Version management**: Run `bundle exec rake update_changelog` after releases to update version headers (if task exists)
34-
- **Examples**: Run `grep -A 3 "^#### " CHANGELOG.md | head -30` to see real formatting examples
31+
- **Update CHANGELOG.md for user-visible changes only** (features, bug fixes,
32+
breaking changes, deprecations, performance improvements)
33+
- **Do NOT add entries for**: linting, formatting, refactoring, tests, or
34+
documentation fixes
35+
- **Format**:
36+
`[PR 123](https://github.com/shakacode/package_json/pull/123) by [username](https://github.com/username)`
37+
(no hash in PR number)
38+
- **Use `/update-changelog` command** for guided changelog updates with
39+
automatic formatting
40+
- **Version management**: Run `bundle exec rake update_changelog` after releases
41+
to update version headers (if task exists)
42+
- **Examples**: Run `grep -A 3 "^#### " CHANGELOG.md | head -30` to see real
43+
formatting examples
3544

3645
## ⚠️ FORMATTING RULES
3746

38-
**RuboCop is the SOLE authority for formatting Ruby files. NEVER manually format code.**
47+
**RuboCop is the SOLE authority for formatting Ruby files. NEVER manually format
48+
code.**
3949

4050
### Standard Workflow
51+
4152
1. Make code changes
4253
2. Run `bundle exec rubocop -a` to auto-fix violations
4354
3. Commit changes
4455

4556
### Debugging Formatting Issues
57+
4658
- Check for violations: `bundle exec rubocop`
4759
- Fix violations: `bundle exec rubocop -a`
4860
- If CI fails on formatting, always run automated fixes, never manual fixes
@@ -51,13 +63,15 @@ These requirements are non-negotiable. CI will fail if not followed.
5163

5264
### Core Components
5365

54-
This is a Ruby gem that provides a Ruby interface for managing `package.json` files and JavaScript package managers.
66+
This is a Ruby gem that provides a Ruby interface for managing `package.json`
67+
files and JavaScript package managers.
5568

5669
#### Ruby Side (`lib/package_json/`)
5770

5871
- **`lib/package_json.rb`**: Main entry point and core PackageJson class
5972
- **`lib/package_json/manager.rb`**: Base class for package manager abstraction
60-
- **`lib/package_json/managers/`**: Specific implementations for npm, yarn, pnpm, bun, etc.
73+
- **`lib/package_json/managers/`**: Specific implementations for npm, yarn,
74+
pnpm, bun, etc.
6175

6276
### Build System
6377

@@ -67,11 +81,13 @@ This is a Ruby gem that provides a Ruby interface for managing `package.json` fi
6781

6882
## Important Notes
6983

70-
- This gem provides a "middle-level" abstraction over JavaScript package managers
84+
- This gem provides a "middle-level" abstraction over JavaScript package
85+
managers
7186
- Supports npm, yarn (classic and berry), pnpm, and bun
7287
- Does not capture or intercept package manager output by default
7388
- Uses `Kernel.system` under the hood for package manager operations
7489

7590
## Contributing
7691

77-
Bug reports and pull requests are welcome on GitHub at https://github.com/shakacode/package_json.
92+
Bug reports and pull requests are welcome on GitHub at
93+
https://github.com/shakacode/package_json.

0 commit comments

Comments
 (0)