-
Notifications
You must be signed in to change notification settings - Fork 73
Fixed rules violation in the linter code #732
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
Conversation
* disable `FL0046` for `Identifiers.fs` * make constants instead of let bindings in `SourceLength.fs`
|
@Numpsy could you review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors linter rule code by disabling a specific lint rule, converting various test thresholds into compile-time constants, and modernizing string formatting in the build script.
- Add
[<Literal>]to test threshold definitions inSourceLength.fs - Disable
FL0046and replacesprintfwith string interpolation inIdentifiers.fs - Update
build.fsxto use interpolation andDotNet.nugetPush, remove Paket
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs | Convert test length thresholds to [<Literal>] constants |
| src/FSharpLint.Core/Rules/Identifiers.fs | Disable FL0046 and switch sprintf to string interpolation |
| src/FSharpLint.Core/Framework/Ast.fs | Adjust pattern match for SynExpr.Typar |
| build.fsx | Remove Paket ref, switch to interpolation, replace NuGet push |
Comments suppressed due to low confidence (4)
tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs:232
- The
TestMaxLinesInMemberfixture is declared but has no assertions; add concrete test cases to verify member-line limits.
// TODO: Add tests.
tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs:307
- The
TestMaxLinesInUnionfixture is missing actual test assertions; include tests to validate union-line constraints.
// TODO: Add tests.
tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs:342
- The
TestMaxLinesInEnumfixture has no implemented tests; consider adding assertions to cover enum-line length behavior.
// TODO: Add tests.
src/FSharpLint.Core/Framework/Ast.fs:373
- If
SynExpr.Typaractually has two parameters, collapsing to one may miss data; verify the AST shape change is intentional.
| SynExpr.Typar(_) -> ()
|
Looks ok to me (I've been putting the format specifiers in interpolated strings for my own code, I don't know if copilot can be configured to not complain about that?) |
|
I've been having a go at getting the Fornax doc generation working over in Numpsy@686d139, not quite working yet though |
You explained the what but not the why. What was the motivation for doing this? |
|
Well, someone decided to name the identifiers in pascal case. Which is logical. |
Or file that as a bug (with a testcase) so that we can take a closer look? I'm still not sure I understand the issue. |
But what was the motivation for having constants (literals) in the first place? |
|
I do not know. Someone did that before me and you in this project |
|
I'm not referring to previous code, I'm referring to what you have put in this PR description: "make constants instead of let bindings in SourceLength.fs", what is the motivation of making them constants instead of let bindings? |
|
Because constants are Pascal case and let bindings are Camel case. But in the code let bindings are Camel case |
|
It is so hard to decipher what you exactly mean man. Let me see: are you referring to running FSharpLint on itself? Because I just tested removing that fsharp:disable line (see https://github.com/knocte/FSharpLint/commits/wip/removeRuleDisabling/ ) and CI still passes (SelfCheck still green) so I'm still wondering what this change is for. |
|
The previously seen issue might have been a bug that was fixed by #758? (where FL0046 previously fired for let bindings, and now doesn't) |
FL0046forIdentifiers.fsSourceLength.fs