Skip to content

Vasty improve linting performance - #146

Open
httphypixelnet wants to merge 11 commits into
frcsoftware:mainfrom
httphypixelnet:fix/lint-performance
Open

Vasty improve linting performance#146
httphypixelnet wants to merge 11 commits into
frcsoftware:mainfrom
httphypixelnet:fix/lint-performance

Conversation

@httphypixelnet

@httphypixelnet httphypixelnet commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Fixed unintended analyzation of non-source files in the validate-regions script and set remark to only check for dead links in a CI environment.

Closes #143 and #87

Meta

Merge checklist:

@github-actions

Copy link
Copy Markdown

🌐 Preview URL: https://pr-146.frcsoftware.pages.dev

Comment thread scripts/validate-regions.ts Outdated
@httphypixelnet
httphypixelnet requested a review from samfreund July 28, 2026 01:49
Comment thread .remarkrc.mjs Outdated
@httphypixelnet
httphypixelnet requested a review from a team as a code owner July 28, 2026 02:23
@github-actions github-actions Bot added the infra Any infrastructure for building the website or syncing files label Jul 28, 2026

@Daniel1464 Daniel1464 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work! Here's another thing that probably should be bundled in this PR:

lint-staged actually passes the changed files as command-line args. Our lint-staged configuration calls pnpm format, which in turn calls prettier --write ., and pnpm lint, which calls eslint . and a bunch of other things. This meant that every time we made a commit, we were running the formatters on the whole repo instead of individual committed files.

To fix this, just change the lint-staged config in package.json to this:

"lint-staged": {
    "**/*": [
        "prettier --write",
        "eslint",
        "pnpm typecheck & pnpm lint:md & pnpm lint:regions",
        "pnpm vale:setup && vale sync && vale"
    ],
    "examples/**/*.java": "sh -c 'cd examples && ./gradlew spotlessApply'",
    "src/data/glossary.ts": [
        "pnpm generate:glossary",
        "git add src/content/docs/resources/glossary.mdx"
    ]
}

This allows for prettier, eslint, and vale to run only on your committed files (the other lint scripts seem to fail if you do that.

const ROOT = fileURLToPath(new URL('..', import.meta.url));
const EXAMPLES_DIR = join(ROOT, 'examples');
const DOCS_DIR = join(ROOT, 'src', 'content', 'docs');
const SKIP_DIRS = new Set(['build', '.gradle', 'node_modules']);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might as well add the gradle directory (not .gradle) while you're at it, even if it doesn't improve perf by that much.

@httphypixelnet

Copy link
Copy Markdown
Contributor Author

See #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Any infrastructure for building the website or syncing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate run time of validate-regions

4 participants