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

Delegate loading .editorconfig properties to ec4j library. #752

Merged

Conversation

Tapchicoma
Copy link
Collaborator

Remove custom logic how to load and cache editorconfig properties for specific file and use ec4j library for it.

For now implementation just uses raw properties values. In the future, we could use custom Properties to also do validation of .editorconfig.

Fixes #742

@Tapchicoma Tapchicoma force-pushed the rework-editorconfig-loading branch from 6c024c9 to 20e1a83 Compare May 30, 2020 10:10
@Tapchicoma
Copy link
Collaborator Author

FYI: {kt, kts} is not supported by official .editorconfig spec - see editorconfig/editorconfig#148

/**
* In-memory [Cache] implementation that could be safely accessed from any [Thread].
*/
internal class ThreadSafeEditorConfigCache : Cache {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it's worth to test this class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is pretty straightforward, but I will add some tests 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some thoughts I've decided to not write tests for this class. Class itself is pretty straightforward, though writing non-flaky multithreading tests are hard and not worth, in this particular case, an effort.

@Tapchicoma Tapchicoma force-pushed the rework-editorconfig-loading branch from 20e1a83 to 4f9083b Compare June 1, 2020 17:55
Remove custom logic how to load and cache editorconfig properties for specific file and use ec4j library for it.

For now implementation just uses raw properties values. In the future, we could use custom Properties to also do validation of .editorconfig.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
@Tapchicoma Tapchicoma merged commit cdf871b into pinterest:master Jun 1, 2020
@Tapchicoma Tapchicoma deleted the rework-editorconfig-loading branch June 1, 2020 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot turn off one rule for one package
2 participants