Skip to content
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

Unset unset values #123

Closed
piranna opened this issue Jul 2, 2023 · 7 comments
Closed

Unset unset values #123

piranna opened this issue Jul 2, 2023 · 7 comments
Assignees

Comments

@piranna
Copy link

piranna commented Jul 2, 2023

According to the spec, unset values should be considered as the definitions are not being provided in the .editorconfig file (they are "unset"), but reading the code, they are just only used as part of Typescript types. Is this on purpose so they can be passed down to the code using this library, or should they be filtered out so devs don't need to check for it explicitly? I think the second one... If so, I can create a quick PR for it.

@hildjj
Copy link
Collaborator

hildjj commented Jul 2, 2023

I think this is likely a bug. Will look at it.

@hildjj
Copy link
Collaborator

hildjj commented Jul 2, 2023

Wow. The tests are explicitly wrong.

https://github.com/editorconfig/editorconfig-core-test/blob/5ca0b296dc31124d0303895c163013450bd97958/filetree/CMakeLists.txt#L94

@hildjj
Copy link
Collaborator

hildjj commented Jul 2, 2023

@hildjj
Copy link
Collaborator

hildjj commented Jul 2, 2023

OK, I can do a couple of things:

  • Give an unset() function that goes through the resulting property object removing anything with the value "unset"
  • Add an unset property to ParseOptions that will call unset automatically at the end of processing
  • Add a --unset flag to the CLI to set that property

I don't think I can make it the default, since "plugins" are supposed to be processing "unset"'s, according to the core devs.

Reactions?

@hildjj hildjj self-assigned this Jul 2, 2023
@piranna
Copy link
Author

piranna commented Jul 2, 2023

Si, it's intended that unseted values have a values of unset instead of undefined, and I need to process unset values on my Code at application level, isn't It?

@piranna
Copy link
Author

piranna commented Jul 2, 2023

And yes, I've read both threads, and found that dumb :-(

@hildjj
Copy link
Collaborator

hildjj commented Jul 2, 2023

And yes, I've read both threads, and found that dumb :-(

Same here. Anyway, I'm going to land this "fix" for you, and push out 2.0.

@hildjj hildjj closed this as completed in 30fe8ae Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants