Skip to content

chore: willboosterify this repo#133

Merged
WillBooster-bot merged 1 commit intomainfrom
wbfy
Apr 26, 2026
Merged

chore: willboosterify this repo#133
WillBooster-bot merged 1 commit intomainfrom
wbfy

Conversation

@WillBooster-bot
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@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 updates several dependencies, including oxfmt and oxlint-tsgolint, and modifies configurations in .idea/watcherTasks.xml, lefthook.yml, and package.json to exclude package.json from formatting. Review feedback identifies several opportunities to eliminate redundant exclusion patterns where files are already filtered by extension or variable definition. Additionally, suggestions were made to simplify regex patterns for file matching and to improve the robustness of shell commands when handling file lists containing spaces.

Comment thread .idea/watcherTasks.xml
<component name="ProjectTasksOptions">
<TaskOptions isEnabled="true">
<option name="arguments" value="node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern $FilePathRelativeToProjectRoot$" />
<option name="arguments" value="node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern !**/package.json $FilePathRelativeToProjectRoot$" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The exclusion pattern !**/package.json is redundant for this task because it only triggers on .astro files (as specified in line 9). This redundancy is repeated in several other task options for non-JSON extensions throughout this file. According to the repository style guide, code should be simplified as much as possible to eliminate redundancy.

Suggested change
<option name="arguments" value="node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern !**/package.json $FilePathRelativeToProjectRoot$" />
<option name="arguments" value="node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern $FilePathRelativeToProjectRoot$" />
References
  1. Simplify code as much as possible to eliminate redundancy. (link)

Comment thread lefthook.yml
# Lefthook expands {staged_files} as shell-escaped args, so paths with spaces stay intact.
oxlint_files="$(printf '%s\n' {staged_files} | grep -E '(\.astro$|\.cjs$|\.cts$|\.js$|\.jsx$|\.mjs$|\.mts$|\.svelte$|\.ts$|\.tsx$|\.vue$)' || true)"
oxfmt_files="$(printf '%s\n' {staged_files} | grep -E '(\.astro$|\.cjs$|\.css$|\.cts$|\.gql$|\.graphql$|\.hbs$|\.htm$|\.html$|\.js$|\.json$|\.json5$|\.jsonc$|\.jsx$|\.less$|\.md$|\.mdx$|\.mjs$|\.mts$|\.scss$|\.svelte$|\.toml$|\.ts$|\.tsx$|\.vue$|\.yaml$|\.yml$)' || true)"
oxfmt_files="$(printf '%s\n' {staged_files} | grep -E '(\.astro$|\.cjs$|\.css$|\.cts$|\.gql$|\.graphql$|\.hbs$|\.htm$|\.html$|\.js$|\.json$|\.json5$|\.jsonc$|\.jsx$|\.less$|\.md$|\.mdx$|\.mjs$|\.mts$|\.scss$|\.svelte$|\.toml$|\.ts$|\.tsx$|\.vue$|\.yaml$|\.yml$)' | grep -v -E '(^|/)package\.json$' || true)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The regex for matching file extensions can be simplified for better readability and maintainability. Instead of repeating the anchor $ for each extension, you can group them and use a single anchor at the end.

        oxfmt_files="$(printf '%s\n' {staged_files} | grep -E '\.(astro|cjs|css|cts|gql|graphql|hbs|htm|html|js|json|json5|jsonc|jsx|less|md|mdx|mjs|mts|scss|svelte|toml|ts|tsx|vue|yaml|yml)$' | grep -v -E '(^|/)package\.json$' || true)"
References
  1. Simplify code as much as possible to eliminate redundancy. (link)

Comment thread lefthook.yml

if [ -n "$oxfmt_files" ]; then
node node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern $oxfmt_files
node node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern '!**/package.json' $oxfmt_files
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The exclusion pattern '!**/package.json' is redundant here because package.json is already filtered out from the $oxfmt_files variable in line 19. Additionally, note that $oxfmt_files is used without quotes, which will cause the command to fail if any staged filenames contain spaces. While this is an existing pattern in the file, it's worth considering a more robust way to handle the file list (e.g., using xargs).

          node node_modules/.bin/oxfmt --write --no-error-on-unmatched-pattern $oxfmt_files
References
  1. Simplify code as much as possible to eliminate redundancy. (link)

@WillBooster-bot WillBooster-bot merged commit b4ba757 into main Apr 26, 2026
10 checks passed
@WillBooster-bot WillBooster-bot deleted the wbfy branch April 26, 2026 22:17
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.

1 participant