Skip to content

Conversation

@jl-wynen
Copy link
Member

First step for scipp/copier_template#70

I adapted the setup from Scitacean because I'm happy with it. But please check whether the selected rules are a good choice.

I did not enable D because there are too many violations. But it allows us to enforce a docstring format and can help avoid rst pitfalls. I'm in favour of enabling it, but please comment!

@YooSunYoung
Copy link
Member

YooSunYoung commented Apr 16, 2024

I did not enable D because there are too many violations. But it allows us to enforce a docstring format and can help avoid rst pitfalls. I'm in favour of enabling it, but please comment!

I'm up for enabling docstring formatting!
But that can be done separately since it'll be a lot of fixing as you said.

@jl-wynen
Copy link
Member Author

I tried out the pyupgrade fixes. There are some useful ones that we should probably do. But we'd have to run it again when we drop python 3.9. Since that happens soon, I'd just leave it for now and run pyupgrade later.

Comment on lines +120 to +137
# those files have an increased risk of relying on import order
"__init__.py" = ["I"]
# asserts are fine because this code is meant to be used with pytest
"src/scipp/testing/*" = ["S101"]
"tests/*" = [
"S101", # asserts are fine in tests
"B018", # 'useless expressions' are ok because some tests just check for exceptions
]
"tools/*" = [
"S101", # asserts are fine, we do not run tools with optimizations
"T201", # printing is ok for internal tools
]
"*.ipynb" = [
"E501", # longer lines are sometimes more readable
"I", # we don't collect imports at the top
"S101", # asserts are used for demonstration and are safe in notebooks
"T201", # printing is ok for demonstration purposes
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for putting detailed reasons!

@MridulS
Copy link
Member

MridulS commented Apr 18, 2024

Shouldn't https://github.com/scipp/scipp/blob/main/setup.cfg also be removed? All the config now is in pyproject.toml

Copy link
Member

@nvaytet nvaytet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go ahead with this 👍

@jl-wynen
Copy link
Member Author

I added the remaining rules from scipp/esssans#127. Some required a lot of fixes, esp PT, but I think it is good to have a consistent style.

I found a broken test thanks to PT011. :-)

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.

6 participants