[Feature Suggestion] Allow disabling analytics rules and ignoring directories
Expected Behavior
Hi! Thank you so much to all the contributors for the work you do! I may be able to contribute to this change in the future, though not right now, but just wanted to log this feature suggestion now.
My specific needs stem from:
- Wanting to disable the single field record analytics rule as I think it can add a lot of important context to have a named argument in many circumstances, but I don't want to fully disable the analytics as then I for example lose the unused imports greying out in the editor etc.
- Wanting to ignore .elm-spa/generated which Elm SPA automatically generates so I don't have
problemswith missing type annotations showing up in my VSCodeProblemstab
Current Behavior
Right now I can only enable or disable all analytics rules at once and only for all files in my repo
Possible Solution
Think it's obvious from above :), for "related work" Elm Analytics has these features so maybe code / implementation strategies could be borrowed from there
You can use elm-analyse.json to disable rules and ignore directories . See their documentation (yes, we also need to have that on our side)
That being said, the rule your speaking of, will default to off in the next release.
Emil Goldsmith Olesen @.***> schrieb am Do., 10. Juni 2021, 11:44:
Expected Behavior
Hi! Thank you so much to all the contributors for the work you do! I may be able to contribute to this change in the future, though not right now, but just wanted to log this feature suggestion now.
My specific needs stem from:
- Wanting to disable the single field record analytics rule as I think it can add a lot of important context to have a named argument in many circumstances, but I don't want to fully disable the analytics as then I for example lose the unused imports greying out in the editor etc.
- Wanting to ignore .elm-spa/generated which Elm SPA automatically generates so I don't have problems with missing type annotations showing up in my VSCode Problems tab
Current Behavior
Right now I can only enable or disable all analytics rules at once and only for all files in my repo Possible Solution
Think it's obvious from above :), for "related work" Elm Analytics has these features so maybe code / implementation strategies could be borrowed from there
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNLEZEDVZDTA6UATK4QII3TSCCP3ANCNFSM46N5REFQ .
Great about the default for the rule, but I already have an elm-analyse.json and it works fine when I run elm analyse for example in CI, but those errors still show in vscode
On Thu, 10 Jun 2021 at 11.55, Kolja Lampe @.***> wrote:
You can use elm-analyse.json to disable rules and ignore directories . See their documentation (yes, we also need to have that on our side)
That being said, the rule your speaking of, will default to off in the next release.
Emil Goldsmith Olesen @.***> schrieb am Do., 10. Juni 2021, 11:44:
Expected Behavior
Hi! Thank you so much to all the contributors for the work you do! I may be able to contribute to this change in the future, though not right now, but just wanted to log this feature suggestion now.
My specific needs stem from:
- Wanting to disable the single field record analytics rule as I think it can add a lot of important context to have a named argument in many circumstances, but I don't want to fully disable the analytics as then I for example lose the unused imports greying out in the editor etc.
- Wanting to ignore .elm-spa/generated which Elm SPA automatically generates so I don't have problems with missing type annotations showing up in my VSCode Problems tab
Current Behavior
Right now I can only enable or disable all analytics rules at once and only for all files in my repo Possible Solution
Think it's obvious from above :), for "related work" Elm Analytics has these features so maybe code / implementation strategies could be borrowed from there
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABNLEZEDVZDTA6UATK4QII3TSCCP3ANCNFSM46N5REFQ
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606#issuecomment-858483693, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKO66UWKJ6FLIO7VCGNUQDTSCDXJANCNFSM46N5REFQ .
Is the file next to the elm.json?
Emil Goldsmith Olesen @.***> schrieb am Do., 10. Juni 2021, 15:14:
Great about the default for the rule, but I already have an elm-analyse.json and it works fine when I run elm analyse for example in CI, but those errors still show in vscode
On Thu, 10 Jun 2021 at 11.55, Kolja Lampe @.***> wrote:
You can use elm-analyse.json to disable rules and ignore directories . See their documentation (yes, we also need to have that on our side)
That being said, the rule your speaking of, will default to off in the next release.
Emil Goldsmith Olesen @.***> schrieb am Do., 10. Juni 2021, 11:44:
Expected Behavior
Hi! Thank you so much to all the contributors for the work you do! I may be able to contribute to this change in the future, though not right now, but just wanted to log this feature suggestion now.
My specific needs stem from:
- Wanting to disable the single field record analytics rule as I think it can add a lot of important context to have a named argument in many circumstances, but I don't want to fully disable the analytics as then I for example lose the unused imports greying out in the editor etc.
- Wanting to ignore .elm-spa/generated which Elm SPA automatically generates so I don't have problems with missing type annotations showing up in my VSCode Problems tab
Current Behavior
Right now I can only enable or disable all analytics rules at once and only for all files in my repo Possible Solution
Think it's obvious from above :), for "related work" Elm Analytics has these features so maybe code / implementation strategies could be borrowed from there
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ABNLEZEDVZDTA6UATK4QII3TSCCP3ANCNFSM46N5REFQ
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/elm-tooling/elm-language-server/issues/606#issuecomment-858483693 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEKO66UWKJ6FLIO7VCGNUQDTSCDXJANCNFSM46N5REFQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606#issuecomment-858612242, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNLEZHWEPBJIMVXIWR4KXTTSC3D7ANCNFSM46N5REFQ .
Yep! At the root
On Thu, 10 Jun 2021 at 18.16, Kolja Lampe @.***> wrote:
Is the file next to the elm.json?
Emil Goldsmith Olesen @.***> schrieb am Do., 10. Juni 2021, 15:14:
Great about the default for the rule, but I already have an elm-analyse.json and it works fine when I run elm analyse for example in CI, but those errors still show in vscode
On Thu, 10 Jun 2021 at 11.55, Kolja Lampe @.***> wrote:
You can use elm-analyse.json to disable rules and ignore directories . See their documentation (yes, we also need to have that on our side)
That being said, the rule your speaking of, will default to off in the next release.
Emil Goldsmith Olesen @.***> schrieb am Do., 10. Juni 2021, 11:44:
Expected Behavior
Hi! Thank you so much to all the contributors for the work you do! I may be able to contribute to this change in the future, though not right now, but just wanted to log this feature suggestion now.
My specific needs stem from:
- Wanting to disable the single field record analytics rule as I think it can add a lot of important context to have a named argument in many circumstances, but I don't want to fully disable the analytics as then I for example lose the unused imports greying out in the editor etc.
- Wanting to ignore .elm-spa/generated which Elm SPA automatically generates so I don't have problems with missing type annotations showing up in my VSCode Problems tab
Current Behavior
Right now I can only enable or disable all analytics rules at once and only for all files in my repo Possible Solution
Think it's obvious from above :), for "related work" Elm Analytics has these features so maybe code / implementation strategies could be borrowed from there
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ABNLEZEDVZDTA6UATK4QII3TSCCP3ANCNFSM46N5REFQ
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <
https://github.com/elm-tooling/elm-language-server/issues/606#issuecomment-858483693
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AEKO66UWKJ6FLIO7VCGNUQDTSCDXJANCNFSM46N5REFQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/elm-tooling/elm-language-server/issues/606#issuecomment-858612242 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABNLEZHWEPBJIMVXIWR4KXTTSC3D7ANCNFSM46N5REFQ
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606#issuecomment-858757771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKO66WBZBU7I2GVLWB3J6LTSDQMFANCNFSM46N5REFQ .
Can you setup an example repo where this reproduces? It's really hard to see why this fails otherwise.
I’ll try making the time, and get back to you if I do!
On Fri, 11 Jun 2021 at 12.05, Kolja Lampe @.***> wrote:
Can you setup an example repo where this reproduces? It's really hard to see why this fails otherwise.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/elm-tooling/elm-language-server/issues/606#issuecomment-859467282, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKO66STMKHNRLGNIYHSHA3TSHNXRANCNFSM46N5REFQ .
I'm also interested in this. We have an elm-analyse.json file that looks like this:
{
"checks": {
"ExposeAll": false,
"ImportAll": false,
"SingleFieldRecord": false,
"TriggerWords": false,
"UseConsOverConcat": false,
"UnnecessaryParens": false
},
"excludedPaths": [
"generated_api_src"
]
}
The plugin works fine up until version 1.5.3, but for versions 2.0.0 and above I get a bunch of errors listed in the Problems tab in VSCode. I guess this is because it no longer ignores the folders listed in excludedPaths. Do you see anything wrong with the elm-analyse.json that should cause this?
No, in fact I just setup a test repo with that config and was able to confirm, that excludedPaths work on Linux with the latest release.
Thanks for the quick response. I figured out what my problem was (not really related to this issue, but perhaps useful nonetheless): Turned out I had an old elm-format version install globally (v0.8.2). We also have a version installed locally in the project (v0.8.5). Since we have a monorepo, the binary is not located at node_modules/elm-format/bin, but rather at frontend/node_modules/elm-format/bin. I guess this was the issue, since the "Elm LS: Elm Format Path" config option says it should look for local versions first if its left empty. So I had to change this to frontend/node_modules/elm-format/bin, and now the errors are gone :)