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

Add ruff configuration to offer standardized way for formatting #137

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TobiasSpohn
Copy link
Contributor

Description

Added a basic configuration of ruff in order to try to standardize formatting in the future using @prithviulm first suggestion and optimizing it for current code style.

  • Line breaks will be introduced for lines longer than 120 chars.
  • Quotes will be preserved with " or '.
  • Function parameters ending with a , will remain in one line, up until they reach the max 120 chars, before being broken into multiline parameter declarations

Also some linting configs are done to prevent ruff, when being used in an IDE, displaying too many warnings and errors.

In #155 this formatting was already used in commits fdef371, 35000a4, 60943c2 and 60943c2.

Motivation and Context

In the recent PR's we often had the question, how new code should be formatted. This configuration is a first attempt at somewhat standardizing and offering a tool to automatically format newly contributed code.

How Has This Been Tested?

Using the configuration to make the changes in fdef371, 35000a4, 60943c2 and 60943c2.

Types of changes

  • Bug fix
  • New feature
  • Breaking change (Causes existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have documented my changes in /docs/changelog.md.
  • My change requires additional/updated documentation.
  • I have updated the documentation accordingly.
  • I have added/updated the config example for any module docstrings as necessary.
  • I have checked that the change does not contain obvious errors
    (syntax, indentation, mutable default values, etc.).
  • I have tested my changes using 'Load all modules' on the default dummy configuration.
  • All changed Jupyter notebooks have been stripped of their output cells.

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.

2 participants