0

Is there a way to disable pylint just for a range of code lines in VS Code? There's a certain format for a large string I want to preserve to make it more readable, by pylint enforces its own style on save. But I do want it enabled on the rest of the file.

BBrooklyn
  • 350
  • 1
  • 3
  • 15

3 Answers3

1

Thanks for all your suggestions! I found the simplest solution was to switch my formatter to yapf, then use # yapf: disable and # yapf: enable.

BBrooklyn
  • 350
  • 1
  • 3
  • 15
0

VS code does not allow this out of the box. Please see this GitHub issue for some possible workarounds.

Ezra
  • 471
  • 3
  • 14
0

You can disable specific linting for a module or function with # pylint: disable=missing-module-docsting and re-enable it with # pylint: enable=missing-module-docsting. Just replace what the name with the one you are having.

Check: How do I disable pylint unused import error messages in vs code

Tzane
  • 2,752
  • 1
  • 10
  • 21