Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for docstring to not add empty lines and indentation at end #22043

Open
10 tasks done
PanderMusubi opened this issue Apr 30, 2024 · 0 comments
Open
10 tasks done

Comments

@PanderMusubi
Copy link
Contributor

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Docstring created with Ctrl+Alt+D has two new lines and an indentation at the end of the inserted docstring.

Please, add checkbox to Preferences / Editor / Advanced settings / Docstring type with the label No empty lines at end that by default is not checked. This will save the developer navigating to the end of the relevant part and hitting minimally ten times the delete button.

What steps reproduce the problem?

  1. Open a Python file with a function, method or class declaration.
  2. Navigate to the first line of it.
  3. Press Cltr+Alt+D

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

Expected:

    def credentials(filename: str, parent: bool = False) -> dict:
        """
        
        :param filename: DESCRIPTION
        :type filename: str
        :return: DESCRIPTION
        :rtype: dict"""

instead:

    def credentials(filename: str, parent: bool = False) -> dict:
        """
        
        :param filename: DESCRIPTION
        :type filename: str
        :return: DESCRIPTION
        :rtype: dict

        """

Paste Traceback/Error Below (if applicable)

n/a

Versions

  • Spyder version: 5.5.3 (pip)
  • Python version: 3.10.12 64-bit
  • Qt version: 5.15.2
  • PyQt5 version: 5.15.10
  • Operating System: Linux-6.8.0-76060800daily20240311-generic-x86_64-with-glibc2.35

Dependencies

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant