Skip to content

Conversation

@jpoehnelt
Copy link
Owner

@jpoehnelt jpoehnelt commented Mar 28, 2025

  • chore: license file
  • chore: use config folder

Summary by CodeRabbit

  • Chores
    • Consolidated and updated development tooling for code linting, formatting, and commit/push workflows.
    • Streamlined command scripts to better manage formatting and checking processes.
    • Enhanced version control integration settings for more efficient operations.
  • Documentation
    • Added an Apache License, Version 2.0 to clearly define project usage terms.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 28, 2025

Deploying apps-script with  Cloudflare Pages  Cloudflare Pages

Latest commit: 85bbd08
Status: ✅  Deploy successful!
Preview URL: https://b1db3e30.apps-script.pages.dev
Branch Preview URL: https://chore-repo-cleanup.apps-script.pages.dev

View logs

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 28, 2025

Walkthrough

This pull request reorganizes and refines the project's configuration by introducing new files in a dedicated configuration directory and removing legacy configuration files. New lint-staged configurations for commit and push actions, along with an updated prettier ignore file, are added under the .config directory. Husky hook scripts are modified to include shell options and updated file paths. Additionally, VS Code settings, biome.json, and package.json have been updated, and a new LICENSE file has been introduced.

Changes

File(s) Change Summary
.config/.lintstagedrc.commit.js, .config/.lintstagedrc.push.js, .config/.prettierignore Added new configuration files for conditional linting and prettier ignore patterns
.husky/pre-commit, .husky/pre-push Updated hook scripts to include shell options (-e, -x, set -ex) and reference the new config files
.lintstagedrc.{commit.js,push.js}, .prettier{.json,ignore} Removed legacy lint-staged and prettier configuration files
.vscode/settings.json, LICENSE Updated VS Code settings to use the new prettier ignore file and added a new Apache 2.0 license
biome.json, package.json Updated biome.json with VCS settings and restructured package.json scripts (removing old formatting/linting commands and adding new ones)

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant HPre as .husky/pre-commit
  participant LSC as Lint-Staged (.config/.lintstagedrc.commit.js)
  
  Dev->>HPre: Initiate commit
  HPre->>LSC: Pass staged file list
  alt File matches (.js/.ts/.json)
    LSC-->>HPre: Run "pnpm biome --write"
  else Other file types
    LSC-->>HPre: Run "pnpm prettier --check"
  end
  HPre->>Dev: Complete commit process
Loading
sequenceDiagram
  participant Dev as Developer
  participant HPush as .husky/pre-push
  participant LSP as Lint-Staged (.config/.lintstagedrc.push.js)
  
  Dev->>HPush: Initiate push
  HPush->>LSP: Provide list of files
  alt File count >= 5
    LSP-->>HPush: Execute "pnpm build check test"
  else
    LSP-->>HPush: No command executed
  end
  HPush->>Dev: Complete push process
Loading

Possibly related PRs

Poem

In my burrow of code, I hop with cheer,
New configs bloom and the path is now clear.
Hooks that whisper commands in gentle delight,
Old files vanish into the soft moonlight.
I nibble on scripts with a smile so bright!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2540bd4 and 85bbd08.

📒 Files selected for processing (12)
  • .config/.lintstagedrc.commit.js (1 hunks)
  • .config/.lintstagedrc.push.js (1 hunks)
  • .config/.prettierignore (1 hunks)
  • .husky/pre-commit (1 hunks)
  • .husky/pre-push (1 hunks)
  • .lintstagedrc.commit.js (0 hunks)
  • .lintstagedrc.push.js (0 hunks)
  • .pretter.json (0 hunks)
  • .prettierignore (0 hunks)
  • .vscode/settings.json (1 hunks)
  • biome.json (1 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (4)
  • .pretter.json
  • .prettierignore
  • .lintstagedrc.push.js
  • .lintstagedrc.commit.js
🚧 Files skipped from review as they are similar to previous changes (8)
  • .husky/pre-push
  • .vscode/settings.json
  • biome.json
  • .config/.lintstagedrc.push.js
  • .config/.prettierignore
  • .config/.lintstagedrc.commit.js
  • .husky/pre-commit
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @jpoehnelt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request focuses on repository cleanup, specifically addressing license file management and the organization of configuration files. The changes involve moving configuration files to a dedicated .config directory, updating相关 scripts and configurations to reflect this new structure, and adding a LICENSE file.

Highlights

  • Configuration Directory: Moves configuration files (lint-staged, prettier, biome) into a .config directory for better organization.
  • Script Updates: Updates husky pre-commit and pre-push scripts to point to the new configuration file locations within the .config directory. Also updates package.json to point to the new config locations.
  • License File: Adds a LICENSE file to the repository, presumably to specify the licensing terms for the project.
  • Prettier Ignore: Updates the .prettierignore file to include generated files, javascript, typescript, json files, husky directory, the prettier ignore file itself, pnpm files, and the LICENSE file.
  • VSCode Settings: Updates the VSCode settings to point to the new prettier config and ignore paths.

Changelog

Click here to see the changelog
  • .config/.lintstagedrc.commit.js
    • Creation of new lint-staged configuration file for commit hooks, formatting js, ts, and json files with biome and other files with prettier.
  • .config/.lintstagedrc.push.js
    • Creation of new lint-staged configuration file for push hooks, running build, check, and test commands when a certain number of files are changed.
  • .config/.prettierignore
    • Creation of new prettier ignore file, ignoring generated files, js, ts, and json files, husky directory, the prettier ignore file itself, pnpm files, and the LICENSE file.
  • .config/biome.json
    • Creation of new biome configuration file, enabling organize imports and linter rules, including js, ts, and json files, ignoring package.json, enabling vcs with git client, and setting javascript formatter to always use semicolons.
  • .husky/pre-commit
    • Updates the pre-commit husky hook to use the new lint-staged configuration file path in the .config directory, and adds set -ex for debugging.
  • .husky/pre-push
    • Updates the pre-push husky hook to use the new lint-staged configuration file path in the .config directory, and adds set -ex for debugging.
  • .lintstagedrc.commit.js
    • Deletion of old lint-staged configuration file.
  • .lintstagedrc.push.js
    • Deletion of old lint-staged configuration file.
  • .pretter.json
    • Deletion of old prettier configuration file.
  • .prettierignore
    • Deletion of old prettier ignore file.
  • .vscode/settings.json
    • Updates the VSCode settings to point to the new prettier config and ignore paths on lines 22 and 23.
  • LICENSE
    • Addition of a LICENSE file with the Apache 2.0 license.
  • biome.json
    • Deletion of old biome configuration file.
  • package.json
    • Updates the lint and format scripts to use the new biome config path and prettier ignore path on lines 13-16. Removes the format:biome, format:prettier, lint:biome, and lint:prettier scripts.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A tidy repo, a coder's delight,
Configs in order, shining so bright.
With licenses clear and scripts aligned,
A codebase of quality, one of a kind.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request focuses on repository cleanup, including license file addition and configuration folder usage. The changes aim to improve project organization and maintainability. Overall, the changes look good, but there are a few suggestions for improvement.

Summary of Findings

  • Configuration Path Consistency: Ensuring consistent configuration paths across the project improves maintainability and reduces potential errors. The .vscode/settings.json file was updated to use the .config directory, but the package.json file still contains references to the root directory. It would be beneficial to update these references as well.
  • Redundant Ignore Paths: In package.json, the prettier script includes both .config/.prettierignore and .gitignore in the ignore paths. Since .gitignore likely already covers the necessary ignores, including .config/.prettierignore might be redundant. Consider removing the redundant path to simplify the configuration.

Merge Readiness

The pull request is almost ready for merging. Addressing the configuration path consistency and redundant ignore paths would further improve the project's maintainability. I am unable to directly approve the pull request, and recommend that others review and approve this code before merging. Once the identified issues are resolved, the pull request will be in good shape to be merged.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
LICENSE (1)

1-202: Apache License 2.0 successfully added

The license file contains the complete Apache License 2.0 text, which is appropriate for open-source projects.

Consider updating the copyright placeholders on line 190 with actual information:

-   Copyright [yyyy] [name of copyright owner]
+   Copyright 2024 Justin Poehnelt
.config/.lintstagedrc.commit.js (1)

1-6: Lint-staged configuration successfully relocated

The configuration correctly defines conditional execution of linting commands based on file types, with Biome handling JS/TS/JSON files and Prettier handling all other files.

There's an inconsistency in the actions taken - Biome uses --write (auto-fixes issues) while Prettier uses --check (only checks). Consider using the same approach for both:

 export default {
 	"**/*.{js,ts,json}": (filenames) =>
 		filenames.length ? [`pnpm biome --write ${filenames.join(" ")}`] : [],
 	"!(**/*.{js,ts,json})": (filenames) =>
-		filenames.length ? [`pnpm prettier --check ${filenames.join(" ")}`] : [],
+		filenames.length ? [`pnpm prettier --write ${filenames.join(" ")}`] : [],
 };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20ef5ba and 2540bd4.

📒 Files selected for processing (14)
  • .config/.lintstagedrc.commit.js (1 hunks)
  • .config/.lintstagedrc.push.js (1 hunks)
  • .config/.prettierignore (1 hunks)
  • .config/biome.json (1 hunks)
  • .husky/pre-commit (1 hunks)
  • .husky/pre-push (1 hunks)
  • .lintstagedrc.commit.js (0 hunks)
  • .lintstagedrc.push.js (0 hunks)
  • .pretter.json (0 hunks)
  • .prettierignore (0 hunks)
  • .vscode/settings.json (1 hunks)
  • LICENSE (1 hunks)
  • biome.json (0 hunks)
  • package.json (1 hunks)
💤 Files with no reviewable changes (5)
  • .prettierignore
  • biome.json
  • .lintstagedrc.commit.js
  • .pretter.json
  • .lintstagedrc.push.js
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
.config/.prettierignore (1)

1-8: New Prettier ignore configuration successfully created

This file correctly specifies patterns for files that Prettier should ignore. However, I noticed that you're ignoring all JavaScript, TypeScript, and JSON files (lines 2-4), which are typically the main targets for Prettier formatting.

This configuration suggests that JS/TS/JSON files might be handled by another tool (possibly Biome based on other files in the PR). Can you verify this is intentional?

.husky/pre-push (1)

3-5: Improved pre-push hook configuration

The changes improve the hook in two ways:

  1. Adding set -ex enhances error handling by exiting on failures and adds visibility by printing commands before execution
  2. Moving the lint-staged configuration to the .config directory follows the PR objective of centralizing configuration files
.husky/pre-commit (1)

3-4: Good shell script improvements

Adding set -ex enhances script reliability by exiting on errors and providing better debugging through command echoing. Also correctly updated the config path to the new location in .config folder.

.config/.lintstagedrc.push.js (1)

1-3: LGTM: Good conditional check for running tests

The implementation looks good - running full tests only when 5+ files change is a sensible optimization to avoid unnecessary test runs for small changes.

.config/biome.json (1)

1-25: Comprehensive Biome configuration

Good configuration with appropriate settings for schema validation, import organization, linting with recommended rules, file patterns, and formatting preferences. The file ignores and includes are properly set up.

package.json (1)

13-16: Enhance Formatting and Linting Workflow with Config Folder

The new scripts show a clear reorganization by leveraging the dedicated configuration folder. Specifically:

  • Line 13: The "biome" script now explicitly uses a configuration file via --config-path .config/biome.json and includes --no-errors-on-unmatched to handle unmatched items gracefully.
  • Line 14: The "prettier" script has been updated to reference .config/.prettierignore (in addition to .gitignore), which centralizes ignored paths.
  • Lines 15 & 16: The combined "format" and "lint" scripts now consecutively run Prettier followed by Biome commands (with the --write flag for formatting), thereby standardizing the operations.

These changes improve maintainability and align with using a dedicated configuration folder as outlined in the PR objectives. Ensure that the referenced configuration files exist and are correctly formatted.

@jpoehnelt jpoehnelt force-pushed the chore/repo-cleanup branch from 2540bd4 to d4fd900 Compare March 28, 2025 16:53
@jpoehnelt jpoehnelt changed the title chore/repo cleanup chore: repo cleanup configs, license, etc Mar 28, 2025
@jpoehnelt jpoehnelt merged commit 33e2d25 into main Mar 28, 2025
5 checks passed
@jpoehnelt jpoehnelt deleted the chore/repo-cleanup branch March 28, 2025 17:58
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.

2 participants