-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while getting .editorconfig file #20694
Comments
It should be |
Is this an gitea internal error? Error from the update mirror task? |
It's reported by "editorconfig.Parse", which is called by The problem is that you have invalid syntax in your |
I found this: https://github.com/go-gitea/gitea/blob/main/.editorconfig But in my gitea setup I can't find any .editorconfig. |
It's in your repository. It's a user file, committed by some user into your repository. |
Ach o.k. That must be one of the mirrors. In this case I can't fix it. |
So maybe the proposal could be: "Make Gitea not report user's editorconfig syntax error as repository notice", or only show the syntax error on the proper page clearly. |
We should probably treat values with such errors the same as |
Well, we can ignore the error, but you won't receive the editoconfig anymore then. As these are "hard" errors, https://github.com/editorconfig/editorconfig-core-go/blob/560dd96cabfee7b13fc1e3a3cbcb23c2fcf7258b/definition.go#L53 and will just return nil as editorconfig, this library doesn't seem to have any option to change/disable this behavior either :/ |
Best course of action would probably be to make |
it should be easy to handle either |
No, the spec only indicates
So while I think supporting boolean aliases like YAML does (yes, no, true, false, on, off) is probably fine, I think ultimately, invalid values should just be ignored instead of raising errors. |
@silverwind agreed. Most of them, could be moved to an error as log. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hmm, logging these parser "warnings" might be hard to consume. How about adding a type Editorconfig struct {
Root bool
Definitions []*Definition
config *Config
warnings []string
} Fatal errors should still return |
Is this still a problem? |
Yes, #21257 got stalled. I think it's the right solution to parse graceful and display errors. Ideally the admin page could also show the affected repo, or the admin notice could also be removed entirely. |
…med editorconfigs (#21257) The _graceful_ should fail less when the `.editorconfig` file isn't properly written, e.g. boolean values from YAML or unparseable numbers (when a number is expected). As is... information is lost as the _warning_ (a go-multierror.Error) is ignored. If anybody knows how to send them to the UI as warning; any help is appreciated. Closes #20694 Signed-off-by: Yoan Blanc <[email protected]>
Not yet. It's only for 1.20 |
Description
I found this message in /admin/notices
Error while getting .editorconfig file: normalization error: insert_final_newline=off is not an acceptable value. strconv.ParseBool: parsing "off": invalid syntax
Nothing founded in gitea.log.
Gitea Version
1.17.0
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
Git Version
2.25.1
Operating System
Ubuntu 20.04.4
How are you running Gitea?
Downloaded gitea-1.17.0-linux-amd64
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: