Skip to content

Commit 347d816

Browse files
committed
Be more permissive with names'with'quotes'in
1 parent 1275fd1 commit 347d816

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Changelog for HLint (* = breaking change)
22

3+
Be more permissive with names'with'quotes'in
34
#953, fix incorrect suggestions with free variables and \case
45
#955, make --find generate fixity: not infix:
56
#952, improve refactorings with qualified imports

src/Hint/Naming.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Don't suggest for FFI, since they match their C names
1616
1717
<TEST>
18-
data Yes = Foo | Bar'Test -- data Yes = Foo | BarTest @NoRefactor: refactoring not supported for naming hints.
18+
data Yes = Foo | Bar'Test
1919
data Yes = Bar | Test_Bar -- data Yes = Bar | TestBar @NoRefactor
2020
data No = a :::: b
2121
data Yes = Foo {bar_cap :: Int}
@@ -25,7 +25,7 @@ yes_fooPattern Nothing = 0 -- yesFooPattern Nothing = ... @NoRefactor
2525
no = 1 where yes_foo = 2
2626
a -== b = 1
2727
myTest = 1; my_test = 1
28-
semiring'laws = 1 -- semiringLaws = ... @NoRefactor
28+
semiring'laws = 1
2929
data Yes = FOO_A | Foo_B -- data Yes = FOO_A | FooB @NoRefactor
3030
case_foo = 1
3131
test_foo = 1
@@ -119,7 +119,7 @@ suggestName original
119119
any (`isPrefixOf` original) ["prop_","case_","unit_","test_","spec_","scprop_","hprop_"] = Nothing
120120
| otherwise = Just $ f original
121121
where
122-
good = all isAlphaNum $ drp '_' $ drp '#' $ drp '\'' $ reverse $ drp '_' original
122+
good = all isAlphaNum $ drp '_' $ drp '#' $ filter (/= '\'') $ reverse $ drp '_' original
123123
drp x = dropWhile (== x)
124124

125125
f xs = us ++ g ys

0 commit comments

Comments
 (0)