biome: run from parent to fix silently broken plugin#1063
biome: run from parent to fix silently broken plugin#1063dex4er wants to merge 12 commits intotrunk-io:mainfrom
Conversation
|
Hi! Thanks for the PR! Do you have a repro for this issue? I suspect |
|
Yes, it was noticed in this PR: freelensapp/freelens#874 You can get this commit after merge then remove settings from the .trunk.yaml and see the result: biome plugin silently ignores errors after you'll run If you say |
|
So it must be just |
|
The problem is related to biomejs/biome#6662 which was not really fixed yet and decribed in biomejs/biome#6509 Biome sees the copy of working tree in sandbox as duplicated then refuses to work. My workaround is to use explicit I disabled cache as a first reason of the problem that it was for long time undetected. Biome is so fast that caching is not important. |
|
FYI: I had a lot of troubles with using Biome and Trunk together. In the end my configuration now is: https://github.com/freelensapp/freelens/blob/a4d0d192398878caee3c73d9721f60071fdf9121/.trunk/trunk.yaml#L22 lint:
definitions:
# See https://github.com/trunk-io/plugins/pull/1063
- name: biome
files:
- astro
- css
- graphql
- html
- javascript
- json
- typescript
commands:
- output: regex
success_codes:
- 0
- 1
batch: true
cache_results: false
name: lint
parse_regex: ^::(?P<severity>.*) title=(?P<code>[^,]+),file=(?P<path>[^,]+),line=(?P<line>[^,]+),endLine=[^,]+,col=(?P<col>[^,]+),endColumn=[^:]+::(?P<message>.*)
read_output_from: stdout
run: biome check --config-path=${workspace}/biome.jsonc --reporter=github ${target}
run_from: ${root_or_parent_with(biome.jsonc)}
- output: regex
success_codes:
- 0
batch: true
cache_results: false
formatter: true
name: fmt
parse_regex: ^::(?P<severity>.*) title=(?P<code>[^,]+),file=(?P<path>[^,]+),line=(?P<line>[^,]+),endLine=[^,]+,col=(?P<col>[^,]+),endColumn=[^:]+::(?P<message>.*)
read_output_from: stdout
run: biome format --config-path=${workspace}/biome.jsonc --reporter=github --write ${target}
run_from: ${root_or_parent_with(biome.jsonc)}
run_timeout: 1mso it is now just And the main problem is that if biome uses Actually this is the same with |
|
Thanks for the follow-up. I'm reticent to accept this PR as-is, as it will break older versions of biome, and we try to preserve a reasonable level of backwards compatibility. However, I recognize that the multiple config file flow is a standard Biome idiom. Of the following alternatives, which do you think would work best for you:
|
|
I converted this PR back to a draft. So: I think it is some limitation in Trunk that I miss some variable with the configuration file name. Now I must to use: and it will work only for 1 configuration file If it is not possible to detect more configuration files, then I prefer My configuration, which I use almost every day, really works well in VS Code in real-time. I could prepare it as a proper PR if you allow me. |
It addresses problems:
run_from: ${parent}Now plugin breaks with the error:
With this setting biome correctly detects errors.
files: htmlHTML file types are supported by Biome from 2.0 when enabled in configuration.