Spyder: Disable an Analyze rule for the reported line

Created on 26 Oct 2020  路  3Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Analyzing code with Spyder can result in hints for Convention and Refactor, warnings and errors. The developer can disable a certain rule for a certain line of code by adding e.g. # pylint: disable=R1702 at the end of the line of code. Instead of typing this manually, the IDE can add it when the user right clicks the report for that line line and chooses "Disable in for this line".

The benefit is that a user doesn't need to remember the exact format for the comment that disables a report line.

What steps reproduce the problem?

  1. Open a Python file
  2. Run analyze with F8
  3. Right click on a reported rule and choose "Disable for this line"
  4. The line in code should get comment added on the end which disables Analyze for that rule for this line. The comments can look like # pylint: disable=R1702 or # pylint: disable=R1702,R1703 for more rules. Duplication of rules or disable comments may not occur.

What is the expected output? What do you see instead?

This is a feature request and what is in step 4 should happen, but doens't yet.

Versions

  • Spyder version: 4.1.5 None
  • Python version: 3.8.6 64-bit
  • Qt version: 5.12.9
  • PyQt5 version: 5.12.3
  • Operating System: Linux 5.8.0-7625-generic Ubuntu 20.10
Help wanted Editor Pylint Enhancement

All 3 comments

Thanks for the you suggestion @PanderMusubi! Unfortunately, we don't have time to implement this right now, sorry.

Hello there.
I would like to give it a try. If anyone has any clue or suggestion on where to start, I'll be thankful

Was this page helpful?
0 / 5 - 0 ratings