Skip to content

fix: apply prettier formatting to documentation files#405

Merged
Jamie-BitFlight merged 4 commits intomainfrom
claude/check-actions-updater-cleanup-011CUowtZ78DKPHxX9PYXPeA
Nov 5, 2025
Merged

fix: apply prettier formatting to documentation files#405
Jamie-BitFlight merged 4 commits intomainfrom
claude/check-actions-updater-cleanup-011CUowtZ78DKPHxX9PYXPeA

Conversation

@Jamie-BitFlight
Copy link
Contributor

@Jamie-BitFlight Jamie-BitFlight commented Nov 5, 2025

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test update
  • Build/CI update
  • Other (please describe):

Related Issues

  • Fixes #
  • Related to #

Changes Made

Testing

  • All existing tests pass
  • Added new tests for new functionality
  • Manually tested the changes
  • Updated documentation

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • Documentation

    • Added comprehensive development guidelines and instructions for the project.
  • Tests

    • Simplified test mock setup across multiple test files for improved maintainability.
  • Chores

    • Enhanced linting script with explicit configuration and targeted file directories.

Add detailed onboarding instructions for Copilot and other coding agents,
including:
- Project overview and architecture
- Critical Node.js version requirements (20.x strict)
- Validated build, test, and lint command sequences with timing
- Pre-commit hook behavior and CI/CD pipeline details
- Project structure with key file locations
- Common pitfalls and solutions
- Configuration file reference

All commands were validated by execution to ensure accuracy.
- Fix lint:eslint:fix script that referenced non-existent 'eslint' command
- Change to call eslint directly with --fix flag
- Apply auto-fixes to test files (remove redundant intermediate variables)
- Update copilot-instructions.md to remove resolved bug warning
- Reduce Common Pitfalls list from 7 to 6 items

The lint:fix command now works correctly.
Auto-formatting changes:
- Add blank lines in copilot-instructions.md for better readability
- Normalize quotes in README.md (double to single quotes)
@coderabbitai
Copy link

coderabbitai bot commented Nov 5, 2025

Walkthrough

Adds AI instructions documentation for the GitHub Action Readme Generator project and refactors test mock imports to eliminate intermediate variables. Updates the lint:eslint:fix npm script with explicit ESLint configuration, color output, and targeted paths for linting and fixing.

Changes

Cohort / File(s) Summary
Documentation
\.github/copilot-instructions.md
New file with comprehensive AI instructions, project guidelines, Node.js requirements, development workflows, CI/CD configuration, and debugging tips
Test Mock Refactoring
__tests__/action.test.ts, __tests__/helpers.test.ts, __tests__/inputs.test.ts, __tests__/readme-generator.test.ts
Simplified node:fs mock factory in all test files by directly returning the dynamically imported module instead of assigning to intermediate variable
NPM Scripts
package.json
Updated lint:eslint:fix script to include explicit ESLint config (.eslintrc.cjs), color output flag, and targeted paths (./src/ and ./tests/)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The test mock refactorings follow a consistent, homogeneous pattern across four files, reducing review cognitive load
  • ESLint script update is straightforward configuration change
  • Documentation file is new content that requires reading but minimal technical validation

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title states 'apply prettier formatting to documentation files', but the actual changes include test file modifications (removing intermediate variables in mocks), package.json lint script updates, and a new copilot-instructions.md file—not primarily Prettier formatting. Revise the title to accurately reflect the main changes: consider 'refactor: simplify fs mock imports and update lint configuration' or similar to better represent the test and configuration modifications.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/check-actions-updater-cleanup-011CUowtZ78DKPHxX9PYXPeA

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b314cc and 33dee3c.

⛔ Files ignored due to path filters (2)
  • dist/bin/index.js is excluded by !**/dist/**, !dist/**
  • dist/mjs/inputs.js.map is excluded by !**/dist/**, !**/*.map, !dist/**
📒 Files selected for processing (6)
  • .github/copilot-instructions.md (1 hunks)
  • __tests__/action.test.ts (1 hunks)
  • __tests__/helpers.test.ts (1 hunks)
  • __tests__/inputs.test.ts (1 hunks)
  • __tests__/readme-generator.test.ts (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
__tests__/**.*

⚙️ CodeRabbit configuration file

__tests__/**.*: "Assess the unit test code employing the Vitest testing framework. Confirm that:

  • The tests adhere to Vitest's established best practices.
  • Test descriptions are sufficiently detailed to clarify the purpose of each test."

Files:

  • __tests__/inputs.test.ts
  • __tests__/readme-generator.test.ts
  • __tests__/helpers.test.ts
  • __tests__/action.test.ts
🪛 GitHub Actions: Tag and Release Updated NPM Package
package.json

[error] Test suite failed: one test failed in integration-335. The overall npm test step failed.

🪛 LanguageTool
.github/copilot-instructions.md

[style] ~120-~120: Consider shortening or rephrasing this to strengthen your wording.
Context: ...tion before push Important: If you make changes to action.yml, inputs.ts, or related files...

(MAKE_CHANGES)


[uncategorized] ~169-~169: The official name of this software platform is spelled with a capital “H”.
Context: ...n, next, beta:** 1. Test Workflow (.github/workflows/test.yml): - Runs on: pu...

(GITHUB)


[uncategorized] ~175-~175: The official name of this software platform is spelled with a capital “H”.
Context: ... for PR merge 2. Linting Workflow (.github/workflows/push_code_linting.yml): ...

(GITHUB)


[uncategorized] ~180-~180: The official name of this software platform is spelled with a capital “H”.
Context: ... via reviewdog 3. Deploy Workflow (.github/workflows/deploy.yml): - Only on pu...

(GITHUB)

🔇 Additional comments (8)
package.json (2)

64-64: LGTM: Improved lint script with explicit configuration.

The updated script now explicitly specifies the ESLint config, enables color output, and targets specific directories. This makes the linting behavior more predictable and maintainable.


64-64: Clarify what "integration-335" refers to; the referenced test failure cannot be verified.

The codebase contains no reference to "integration-335" in test files or configurations. The changes in commit fa7bcee are legitimate:

  • The lint script was corrected from a broken npm run eslint -- --fix to a proper direct call: eslint -c .eslintrc.cjs --color --fix ./src/ ./__tests__/
  • Test file modifications remove redundant intermediate variables (standard ESLint auto-fixes)

Without clarification on what "integration-335" refers to, the relationship between this pipeline failure and the linting changes cannot be determined. Please verify manually whether this test exists, when it began failing, and its actual connection to these changes.

.github/copilot-instructions.md (2)

1-235: Excellent comprehensive documentation for AI coding agents.

This documentation provides clear, actionable guidance covering build processes, testing, linting, CI/CD pipelines, and common pitfalls. Well-structured and valuable for maintaining consistency.


169-169: Fix brand name capitalization.

The official brand name is "GitHub" (capital H), not "Github". This appears in workflow file path references on lines 169, 175, and 180.

Apply this diff:

-1. **Test Workflow** (`.github/workflows/test.yml`):
+1. **Test Workflow** (`.GitHub/workflows/test.yml`):

-2. **Linting Workflow** (`.github/workflows/push_code_linting.yml`):
+2. **Linting Workflow** (`.GitHub/workflows/push_code_linting.yml`):

-3. **Deploy Workflow** (`.github/workflows/deploy.yml`):
+3. **Deploy Workflow** (`.GitHub/workflows/deploy.yml`):

Note: Actually, the directory name .github (lowercase) is correct for GitHub Actions. The issue is in the table header or references to "Github" elsewhere. Let me re-check the static analysis hints - they mention the word "Github" needs capital H, but looking at the actual code, I see .github/workflows/ which is the correct directory name. The static analysis tool may be incorrectly flagging the directory path.

Let me revise: The static analysis hints are about general references to the platform name "GitHub" but the file paths .github/ are correct as-is (directory names are lowercase by convention). I should skip this comment.

Also applies to: 175-175, 180-180

__tests__/readme-generator.test.ts (1)

26-28: LGTM: Cleaner mock setup.

The inline return await import(...) pattern eliminates the unnecessary intermediate variable, making the mock more concise and following modern JavaScript best practices. This aligns with Vitest's recommended mock patterns.

Based on coding guidelines.

__tests__/inputs.test.ts (1)

29-31: LGTM: Consistent mock simplification.

This change matches the refactor pattern applied across all test files in this PR, removing the intermediate variable and directly returning the dynamic import. Maintains consistency and follows Vitest best practices.

Based on coding guidelines.

__tests__/action.test.ts (1)

14-16: LGTM: Consistent with test suite refactor.

Same mock simplification applied consistently across the test suite.

Based on coding guidelines.

__tests__/helpers.test.ts (1)

31-33: LGTM: Completes consistent mock refactor across test suite.

This final test file update completes the consistent refactoring of node:fs mocks across all four test files (tests/action.test.ts, tests/helpers.test.ts, tests/inputs.test.ts, tests/readme-generator.test.ts), improving maintainability.

Based on coding guidelines.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

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

This PR addresses code quality improvements by fixing ESLint violations and simplifying redundant code patterns. The changes include:

  • Fixed a redundant script reference in package.json where lint:eslint:fix incorrectly referenced npm run eslint instead of directly invoking eslint
  • Simplified async import patterns in test files by removing unnecessary intermediate variable assignments
  • Added comprehensive coding guidelines documentation for the project

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Fixed incorrect npm script reference in lint:eslint:fix command
tests/readme-generator.test.ts Simplified mock import by removing unnecessary intermediate variable
tests/inputs.test.ts Simplified mock import by removing unnecessary intermediate variable
tests/helpers.test.ts Simplified mock import by removing unnecessary intermediate variable
tests/action.test.ts Simplified mock import by removing unnecessary intermediate variable
dist/mjs/inputs.js.map Auto-generated source map file (build artifact)
.github/copilot-instructions.md Added comprehensive project documentation and coding guidelines

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

@Jamie-BitFlight Jamie-BitFlight merged commit 29bcc62 into main Nov 5, 2025
11 of 12 checks passed
@Jamie-BitFlight Jamie-BitFlight deleted the claude/check-actions-updater-cleanup-011CUowtZ78DKPHxX9PYXPeA branch November 5, 2025 03:39
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.

3 participants