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

Fix for PEP 257 #1136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

charlie-rivos
Copy link

@charlie-rivos charlie-rivos commented Jan 30, 2025

Docstrings are defined in PEP 257 as "A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition." When reuse adds a header, it forcibly adds a space before the docstring violating this principle.

When the style is set to Python and the first line in the file is a docstring, do not add a space between the license and the docstring.

More information can be seen here: https://peps.python.org/pep-0257/

closes #1138

  • Added a change log entry in changelog.d/<directory>/.
  • Added self to copyright blurb of touched files.
  • Added self to AUTHORS.rst.
  • Wrote tests.
  • Documented my changes in docs/man/ or elsewhere.
  • My changes do not contradict
    the current specification.
  • I agree to license my contribution under the licenses indicated in the
    changed files.

@charlie-rivos charlie-rivos changed the title Skip newline before python docstring Fix for PEP 257 Jan 30, 2025
@charlie-rivos charlie-rivos force-pushed the dev/charlie/remove_newline branch 2 times, most recently from 8e15522 to c0b48a4 Compare January 31, 2025 17:58
Docstrings are defined in PEP 257 as "A docstring is a string literal
that occurs as the first statement in a module, function, class, or
method definition." When reuse adds a header, it forcibly adds a
space before the docstring violating this principle.

When the style is set to Python and the first line in the file is a
docstring, do not add a space between the license and the docstring.

Signed-off-by: Charlie Jenkins <[email protected]>
@charlie-rivos charlie-rivos force-pushed the dev/charlie/remove_newline branch from c0b48a4 to 98401a1 Compare January 31, 2025 19:02
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

Successfully merging this pull request may close these issues.

PEP 257 Not respected
1 participant