Closed jkoenig134 closed 5 months ago
@spydon I think the main issues why this occurred is that #689 didn't add a test. For protecting this command for regression issues I'm totally with you, I am open looking into the testing and adding tests for this.
@jkoenig134 thank you! I tried to add a test, but it didn't work.
I just made the following modification and was able to confirm that it works correctly at hand.
final lineLength =
switch (int.tryParse(argResults?['line-length'] as String)) {
final int length => length,
_ => null,
};
melos activate
melos foramt --line-length 120 --set-exit-if-changed
@spydon added the test
@spydon as a follow-up i would really like to add setExitIfChanged and lineLength to the config.
I am mostly though with that. As it is not only a Bugfix - can I PR this?
@spydon as a follow-up i would really like to add setExitIfChanged and lineLength to the config.
I am mostly though with that. As it is not only a Bugfix - can I PR this?
Sure, sounds good!
Description
The flag
--line-length
was added, but it seems like it doesn't work as ArgParser doesn't seem to transform this param to int by default. This fix takes theString
argument and tries parsing it to anint
.Type of Change
feat
-- New feature (non-breaking change which adds functionality)fix
-- Bug fix (non-breaking change which fixes an issue)!
-- Breaking change (fix or feature that would cause existing functionality to change)refactor
-- Code refactorci
-- Build configuration changedocs
-- Documentationchore
-- Chore