Disable pycodestyle Check in SageMaker Notebooks
Disclaimer: This content reflects my personal opinions, not those of any organizations I am or have been affiliated with. Code samples are provided for illustration purposes only, use with caution and test thoroughly before deployment.
The solution in this post is originally proposed by MattC and krassowski in this StakeOverflow thread. I just added some screenshots. Thanks to Nadhya Polanco for pointing me to this solution.
(To view a larger version of a screenshot, right-click on the image and select Open Image in New Tab.)
By default, when you use JupyterLab in Amazon SageMaker Studio, you’ll see some Python code being highlighted with pycodestyle syntax check error. This can get distracting if you don’t care about them or have the checks in the CI/CD pipeline already.
Here is how you can disable it:
Disable the pycodestyle check completely
First, click the Settings menu > Settings Editor.
There are a lot of items in the Settings Editor. Search for Langauge Servers.
Uncheck the pylsp.plugins.pycodestyle.enabled
.
Now you have a clean notebook.
Disable certain checks
If you only need to disable some rules, here is how you can do it.
Right-click on the line with highlighted code > Show diagnostics panel The diagnostics panel will show up. Right click on the rule you want to ignore > Ignore diagnostics like this > Ignore diagnostics with “EXXX” code.