-
Notifications
You must be signed in to change notification settings - Fork 5
chore: repo cleanup configs, license, etc #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying apps-script with
|
| 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 |
WalkthroughThis 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 Changes
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
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
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (12)
💤 Files with no reviewable changes (4)
🚧 Files skipped from review as they are similar to previous changes (8)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
.configdirectory for better organization. - Script Updates: Updates husky pre-commit and pre-push scripts to point to the new configuration file locations within the
.configdirectory. 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
.prettierignorefile 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 -exfor debugging.
- Updates the pre-commit husky hook to use the new lint-staged configuration file path in the .config directory, and adds
- .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 -exfor debugging.
- Updates the pre-push husky hook to use the new lint-staged configuration file path in the .config directory, and adds
- .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
-
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. ↩
There was a problem hiding this 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.jsonfile was updated to use the.configdirectory, but thepackage.jsonfile still contains references to the root directory. It would be beneficial to update these references as well. - Redundant Ignore Paths: In
package.json, theprettierscript includes both.config/.prettierignoreand.gitignorein the ignore paths. Since.gitignorelikely already covers the necessary ignores, including.config/.prettierignoremight 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.
There was a problem hiding this 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 addedThe 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 relocatedThe 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
📒 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 createdThis 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 configurationThe changes improve the hook in two ways:
- Adding
set -exenhances error handling by exiting on failures and adds visibility by printing commands before execution- Moving the lint-staged configuration to the
.configdirectory follows the PR objective of centralizing configuration files.husky/pre-commit (1)
3-4: Good shell script improvementsAdding
set -exenhances script reliability by exiting on errors and providing better debugging through command echoing. Also correctly updated the config path to the new location in.configfolder..config/.lintstagedrc.push.js (1)
1-3: LGTM: Good conditional check for running testsThe 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 configurationGood 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 FolderThe 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.jsonand includes--no-errors-on-unmatchedto 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--writeflag 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.
2540bd4 to
d4fd900
Compare
Summary by CodeRabbit