Skip to content

Commit 6381063

Browse files
committed
PublicValuesNames: fix rule
Fix false positive in case of nested function. The rule should not fire for nested functions because they are not public.
1 parent 2b1cb8f commit 6381063

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FSharpLint.Core/Rules/Conventions/Naming/PublicValuesNames.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let private getIdentifiers (args:AstNodeRuleParams) =
3636
| AstNode.Expression(SynExpr.ForEach(_, _, _, true, pattern, _, _, _)) ->
3737
getPatternIdents AccessControlLevel.Private (getValueOrFunctionIdents args.CheckInfo) false pattern
3838
| AstNode.Binding(SynBinding(_, _, _, _, attributes, _, valData, pattern, _, _, _, _, _)) ->
39-
if not (isLiteral attributes || isExtern attributes) then
39+
if not (isLiteral attributes || isExtern attributes || isNested args args.NodeIndex) then
4040
match identifierTypeFromValData valData with
4141
| Value | Function ->
4242
let accessibility = getAccessControlLevel args.SyntaxArray args.NodeIndex

0 commit comments

Comments
 (0)