Replies: 5 comments 3 replies
-
|
This would be a nice quality-of-life improvement. The current workaround with
A native |
Beta Was this translation helpful? Give feedback.
-
|
What do you think about this proposal, @ematipico? I find myself needing it all the time - to feed the dirty changelog to Claude/Codex CLI. In #8447 (comment), you hinted that you like it, but there are some things you want to discuss first. |
Beta Was this translation helpful? Give feedback.
-
|
just pinging this thread; feels like a nice utility for my workflow, let me know if you'd like a pr |
Beta Was this translation helpful? Give feedback.
-
|
Ended up rolling my own # Lint only uncommitted changes (staged + unstaged)
# Note: delete when Biome adds support for this: https://github.com/biomejs/biome/discussions/8465
[group("checks"), script("bash")]
biome-lint-dirty:
set -euo pipefail
files=()
while IFS= read -r -d '' file; do
files+=("$file")
done < <(
git -c diff.renames=false diff --name-only -z --diff-filter=ACMRTUXB HEAD -- \
'*.ts' '*.tsx' '*.js' '*.jsx' '*.json' '*.css'
git ls-files --others --exclude-standard -z -- \
'*.ts' '*.tsx' '*.js' '*.jsx' '*.json' '*.css'
)
if [ ${#files[@]} -eq 0 ]; then
echo "No uncommitted JS/TS/JSON/CSS files to lint."
exit 0
fi
na biome lint --no-errors-on-unmatched "${files[@]}"
alias bld := biome-lint-dirty |
Beta Was this translation helpful? Give feedback.
-
|
My suggestion would be to default |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
Biome currently has two flags for filtering files based on VCS state:
--staged--changed --since=<ref>There's a gap: no way to check all uncommitted working directory changes (both staged and unstaged) without piping from git:
git diff --name-only HEAD | xargs biome checkProposal
Add a
--dirtyflag (or--modified) that checks all files with uncommitted changes:This would be equivalent to files returned by
git diff --name-only HEAD(staged + unstaged changes vs HEAD).Use Cases
Local development on
main: When working directly on the main branch,--changed --since=mainfinds nothing (HEAD = main). A--dirtyflag would catch all local modifications.Quick pre-push check: Verify all modified files before pushing, regardless of staging state.
Simpler pre-commit hooks: Instead of:
git diff --name-only HEAD | xargs biome checkJust use:
Note
This is related to #3608 which discussed that
--stagedchecks staged files but uses working directory content (not the actual staged content). This proposal is orthogonal—it's about detecting which files to check, not what content to check.Converted from #8447
Beta Was this translation helpful? Give feedback.
All reactions