Open rivy opened 1 month ago
@ematipico Are you able to reproduce this bug?
The error comes from the ignore
crate, so it's possible we are passing an incorrect path. However, we need a reproduction. This is an issue generated by the VCS integration
@ematipico , why are you closing this issue? It's a fundamental problem when running the application. π
We requested a reproduction, but that was never provided. After so much inactivity, we close the issue.
I donβt understand. A reproduction was included in my initial post about the issue. It includes the simple WinOS command line which prompts the bug and the output (including the request to post it here to help you fix the issue).
I donβt understand. A reproduction was included in my initial post about the issue. It includes the simple WinOS command line which prompts the bug and the output (including the request to post it here to help you fix the issue).
Could you share the .gitignore
in the directory where you executed Biome? Without it, I think we are not able to reproduce the error.
@Conaclos , happy to do so, and thanks for looking at this issue.
# git ignore config file
# v2024-04-30 [rivy]
# spell-checker:ignore () yarnrc (jargon) globstar (names) deno dlang (people) Roy Ivy III * rivy
# NOTE: Git GLOBSTAR syntax [see `git help gitignore`]
# * ref: [.gitignore] http://git-scm.com/docs/gitignore @@ http://archive.is/Rk6rO
# * ref: [Generate a 'gitignore'](https://gitignore.io) ; eg, <https://gitignore.io/api/node>
# build/dist artifacts
/build
/[._@#$]build
/dist
/target
# note: `git add --force dist && git commit -m 'change: add updated dist artifacts'` will still add any desired distribution artifacts
# note: `git status --ignored -- build dist target` will still show changes (for release testing)
# * project cache directories
/.*-cache
/zig-cache
# coverage data
/coverage
/[._@#$]coverage
/.nyc_output
# D (dlang)
# * dub
/.dub
# note: 'dub.selections.json' is a generated file, useful to applications (for reproducible builds) but not generally for libraries; use `git add --force ...` if needed
/dub.selections.json
# Deno
/deno.lock
# JS/TS
# * ignore JS import/package-related files
/node_modules
/package-lock.json
/yarn.lock
# * allow packaging of lock files into '.deps-lock'
!/.deps-lock/package-lock.json
!/.deps-lock/yarn.lock
# * ignore `yarn`-related files (allows use of "modern" v2+ `yarn`)
# - ref: <https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored> @@ <https://archive.is/Sc1Ab>
.pnp.*
/.yarn/*
!/.yarn/patches
!/.yarn/plugins
!/.yarn/releases
!/.yarn/sdks
!/.yarn/versions
# * use `.yarnrc.yml` for `yarn` config
/.yarnrc
# VSCode
# * ignore local-only VSCode artifacts
# - logs/settings
/.vscode/c_cpp_properties.json
/.vscode/makefile.extension.output
# - precompiled headers for IntelliSense ## spell-checker:ignore ipch
/.vscode/ipch/
## local-start
## local-end
Any use of --config-path
causes the error (eg, biome lint --config-path .biome.lenient.jsonc
, ...).
Let me know if there's anything else I can do to help track down the cause.
@Conaclos , notably:
1 - an empty or missing .gitignore
avoids the error
2 - a .gitignore
with only comments avoids the error
3 - a .gitignore
with any actual "ignore" (non-commentary) content => ERROR
I hope that's helpful.
Unfortunately I cannot reproduce the issue.
Here is my attempt:
β― git init
β― npm init --yes
β― npm i -D @biomejs/biome
β― tree
βββ biome.jsonc
βββ package.json
βββ src
βΒ Β βββ index.js
β― cat biome.jsonc
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
β― npx biome lint --config-path ./biome.jsonc
Checked 3 files in 909Β΅s. No fixes applied.
Note: I am on Linux.
@Conaclos ,
Yes, it looks like a WinOS-specific problem. Using WSL with the exact same project files of my prior example, there is no error.
Here's a minimal reproduction (file repo at https://github.com/rivy-fix/biome-config-bug).
> dir
Volume in drive C is Local Disk
Volume Serial Number is 1C33-48C1
Directory of C:\Users\Roy\AARK\Projects\js\t-biome\repo
2024-08-29 20:22 <DIR> .
2024-08-29 20:22 <DIR> ..
2024-08-29 20:24 <DIR> .git
2024-08-29 20:21 3 .gitignore
2024-08-29 20:19 137 biome.json
2024-08-29 20:09 329 package.json
3 File(s) 469 bytes
3 Dir(s) 369,052,930,048 bytes free
> cat .gitignore
FOO
> cat biome.json
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"vcs": { "clientKind": "git", "enabled": true, "useIgnoreFile": true }
}
> cat package.json
{
"name": "repo",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Roy Ivy III <rivy.dev@gmail.com> (https://rivy.dev/)",
"license": "MIT",
"description": "",
"devDependencies": {
"@biomejs/biome": "^1.8.3"
}
}
> npx biome lint
Checked 2 files in 1988Β΅s. No fixes applied.
> npx biome lint --config-path biome.json
Biome encountered an unexpected error
This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:
Source Location: C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ignore-0.4.21\src\gitignore.rs:229:9
Thread Name: biome::worker_0
Message: path is expected to be under the root
> wsl
...
$ npx biome lint
Checked 2 files in 2ms. No fixes applied.
$ npx biome lint --config-path biome.json
Checked 2 files in 2ms. No fixes applied.
Thank you. That's what I meant with providing a reproduction. Providing only the commands isn't enough.
Sorry, your prior message seemed internal, not directed at me for additional information. I'm happy to help narrow down the issue. Just ask if you need anything else.
Environment information
What happened?
biome lint --config-path .\biome.jsonc
panics, where otherwise,biome lint
completes correctly.Expected result
It should not panic.
Code of Conduct