-
Notifications
You must be signed in to change notification settings - Fork 75
DRAFT: Add new rule IndexerAccessorStyleConsistency #557
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
base: master
Are you sure you want to change the base?
DRAFT: Add new rule IndexerAccessorStyleConsistency #557
Conversation
add .vscode to .gitignore
a8e55ba to
98f3cbd
Compare
| | _ -> | ||
| Array.empty | ||
| else | ||
| failwith (String.Format("Unknown style type %s", styleType)) |
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.
@parhamsaremi nit: in F#, it's better not to use String.Format for string replacement, but rather sprintf, printf, failwithf, etc (please see F# tutorial for reference)
src/FSharpLint.Core/Text.resx
Outdated
| <value>Consider using a longer name, as it is currently too short.</value> | ||
| </data> | ||
| <data name="RulesIndexerAccessorStyleConsistency" xml:space="preserve"> | ||
| <value>Consider switching the style for indexer accessing from OCaml to CSharp or viceversa.</value> |
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.
@parhamsaremi accessing -> accessor?
docs/content/how-tos/rules/FL0077.md
Outdated
|
|
||
| ## Rationale | ||
|
|
||
| F# 6.0 introduces a new style for indexer accessor, similar to the one in C#. But it's convenient for our codebase to be consistent in which accessor to use. |
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.
@parhamsaremi which accessor -> which accessor style
|
|
||
| let generateOutput (range: FSharp.Compiler.Text.Range) (styleMain: string) (styleError: string) = | ||
| { Range = range | ||
| Message = String.Format ("You must use %s styling instead of %s for indexer accessing", styleMain, styleError) |
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.
@parhamsaremi same here (please use sprintf)
51c2871 to
7cf80f6
Compare
Checks for OCaml and CSharp styles. Fixes fsprojects#532
7cf80f6 to
dcf2cc4
Compare
Checks for OCaml and CSharp styles. Fixes #532