-
Notifications
You must be signed in to change notification settings - Fork 65
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
New customPath parameter with test #199
Conversation
added the customPath parameter to the other "addXFileEdit" methods
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
… than getting it from Json encoding
Sorry this flew under the radar. |
You're welcome, thank you for the merge ! |
I think this is problematic because the file doesn't get saved after applying a DartFix. I don't see a way to access the current, unsaved version of the file. A simplified version of this is: final path = 'some/file/path.txt';
// read file contents (this ignores unsaved changes)
final fileContents = File(path).readAsStringSync();
if (fileContents == '') {
changeBuilder.addGenericFileEdit(
(builder) => builder.addSimpleInsertion(0, 'foo'),
customPath: path,
);
} Running the fix multiple times in a row results in I noticed that the analyzer plugin gets file contents from tldr; |
opened issue #296 |
Hi Invertase team,
This is the same as https://github.com/invertase/dart_custom_lint/pull/187, but including a test on the new customPath parameters.
Please let me know if this test is sufficient. I added no test for the other methods where the customPath parameter has been integrated as well in the pull request of Matthias, because I did not found any existing test to extend for those other methods. I even found no call at all to the addYamlFileEdit() method.
Thanks in advance for the review.
Best Regards,
Laurent