-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
✨feat: .selene.toml
and selene.toml
are now detected by order of priority
#591
base: main
Are you sure you want to change the base?
Conversation
Also it closes #469 |
selene.toml
and .selene.toml
are not detected by order of priorityselene.toml
and .selene.toml
are now detected by order of priority
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need changelog + docs.
@chriscerie I'm gonna try but this is my first contribution to a rust project and I'm not a expert in the language so I feeI might cause more noise than it's worth trying to apply the feedback. If you want to co-author please go ahead. |
selene.toml
and .selene.toml
are now detected by order of priority.selene.toml
and selene.toml
are now detected by order of priority
Co-authored-by: boyned//Kampfkarren <boynedmaster@gmail.com>
…we searched both `.selene.toml` and `selene.toml` and none can be read.
…ctions to avoid code repetition.
This allow us to reuse 50% of the code.
Changelog: https://github.com/Zeioth/selene/blob/dot-selene-toml/CHANGELOG.md More infoIn the docs, I've just replaced every mention to Only in |
The PR should be ready merge it. Please tell me if you would like some other changes. Hopefully we can ship it relatively soon. |
Thanks for working on this! Unfortunately I've closed the parent issue for now: #469 (comment) This pr will still be very helpful if the issue gets reopened in the future. If that happens, this pr will also need to update the vscode extension with the new config resolution. |
@@ -16,7 +16,7 @@ FLAGS: | |||
|
|||
OPTIONS: | |||
--color <color> [default: auto] [possible values: Always, Auto, Never] | |||
--config <config> A toml file to configure the behavior of selene [default: selene.toml] | |||
--config <config> A toml file to configure the behavior of selene [default: .selene.toml] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't technically accurate because the default is both selene.toml
and .selene.toml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is .selene.toml
because it has precedence over selene.toml
,
The only place where selene.toml
is mentioned as a possible alternative is docs/src/usagi/configuration
to avoid duplicity that might make the docs harder to understand.
If you want to have a different string there, please tell me exactly, or edit the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need relevant changes to vscode extension.
Co-authored-by: Chris Chang <51393127+chriscerie@users.noreply.github.com>
Co-authored-by: Chris Chang <51393127+chriscerie@users.noreply.github.com>
chriscerie since there are no bugs, the code has already being refactored as specified, and all the new reviews are stylistic preferences, or would affect parts outside the PR, I'm gonna leave the code as it is. Feel free to co-author if you see something you would prefer to do in a different way. The code is safe to merge. |
I appreciate your contribution, but this pr can't be merged until these bugs are fixed (see above comments for root causes). I'm happy to step in and co-author to get this merged but as there are other selene features with higher priority, I make no promises on the timeline. Config with invalid utf-8 characterMissing config |
…turned is not optional anymore, meaning it can't return None.
… the correct error message.
Relevant changes to vscode extension 47b0642 @chriscerie It should be ready but I have no clue how to test this on vscode. Could you test it or tell me how you test it so I can try to reproduce? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… displaying a friendly message.
…rors -> report error and exit. * If path doesn't exist -> check next path. * None of the paths exist? → It uses the default config correctly.
…f-8. Plus, doing so would return a different error than the orignal.
…ng config file: No such file or directory (os error 2)`
…eading config file: No such file or directory (os error 2)`
This PR:
The feature has been tested on neovim + none-ls with:
Example of bad syntax
Example of file detected OK
Example of no config file