robotframework-lsp
robotframework-lsp copied to clipboard
Allow To Suppress/Disable Warnings/Errors From Visual Studio Code GUI
During code development in some cases you want to ignore rules made by robocop
It would be much more efficient to allow to disable rule directly from "Problems" tab
That would add on end of line # robocop: disable=rule1

I would prefer to use names instead of code
In example above following example # robocop: disable=empty-section
link related with rule disable https://robocop.readthedocs.io/en/stable/including_rules.html
Is it even possible to disable a rule globally by any means, so that it is not reported in VS Code? I read the documentation of robocop and robotframework-lsp but I was not able to find it. If not, this feature would be appreciated.
To disable a Robocop rule globally you can configure it (https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/faq.md#how-to-configure-the-robocop-linter)
For the language server rules you can configure the robot.lint.xxxxx settings.
No to disable globally. I want to disable for this line only its like adding at end of line ex. # robocop: disable=0509
@fabioz, thx for pointing out the documentation. It works as expected for my use case.
No to disable globally. I want to disable for this line only its like adding at end of line ex. # robocop: disable=0509
@IlfirinPL understood, that was just to answer the question from @nicolasbillamboz-flowbird (so, keeping the issue open).
I found a way to do it as @nicolasbillamboz-flowbird expects it to work although I am not sure if this is best practice..
In the project root, create a pyproject.toml file.
In this file,
`[tool.robocop] paths = [ "tests" ]
exclude = [
"0327",
"0328",
"0501",
"0504",
"0508",
"0505",
"0506",
"0508",
"0920",
"1015"
]
reports = [ "rules_by_id", "scan_timer" ]
format = "[{severity}] | {rule_id} | {desc} | {source}:{line}" output = "robocop.log"`
This excludes certain rules from popping up..