Open SarthakKumar1997 opened 5 years ago
Hmm, this one looks tricky - it seems there are bugs in both HLint and apply-refact related to this.
Besides, the current approach relies on unsafePrettyPrint
to print the entire LHsDecl
:
which can be quite large, e.g., the entire function definition. This is undesirable - it's better to shift as much printing work to apply-refact as possible.
I disabled refactoring for this hint in https://github.com/ndmitchell/hlint/pull/1036.
I recently added some refactorings to some HLint suggestions (https://github.com/ndmitchell/hlint/pull/614/files). The suggestions were related to list comprehensions, and function names adhering to the camelCase naming convention.
In the case of camelCase, while HLint provides the right refactorings and apply-refact, using the
-s
refactor option, detects that a change is available to be made, the apply-refact package refuses to make the necessary change.For reference, here is a sample piece of code that I used to test this behaviour:
Is this not working because this is a
Bind
type refactoring, or could there be an alternative reason?Please let me know if you need any further information from my side.