Skip to content

Conversation

patrick91
Copy link
Contributor

This PR removes the isort configuration from pyproject.toml

The configuration options we had set aren't supported by ruff just yet,
but I think the default config is pretty much what we want (after all
running ruff now didn't change anything).

I'm also removing the calls to isort, since we want to use ruff for this.

I've also update the format.sh script to use ruff, do we want to keep it?

patch.object(logger, "error"),
patch.object(logger, "warn"),
):
try:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these changes are due to running sh scripts/format.sh :)

@estebanx64
Copy link
Contributor

@patrick91 format.sh can be removed, if you see lint.sh is doing what you wrote in format.sh and was called just by format-import.sh which was removed in your PR too

@alejsdev alejsdev changed the title Remove isort configuration, since we use Ruff now 🔥 Remove isort configuration, since we use Ruff now Apr 3, 2024
@tiangolo
Copy link
Member

tiangolo commented Apr 5, 2024

Great, thanks @patrick91! 🚀


I restored format.sh with the updated commands, it's quite similar with lint.sh, but it's actually different, lint.sh only shows errors, doesn't modify the code, format.sh modifies the code.

@tiangolo tiangolo merged commit e9b2f9f into fastapi:master Apr 5, 2024
gusevyaroslove pushed a commit to gusevyaroslove/fastapi-template that referenced this pull request Aug 4, 2024
@ntairov
Copy link

ntairov commented Nov 12, 2024

@patrick91 I've identified bug when running format.sh script.

./app/scripts/format.sh                                                                                                                                                                                                         ─╯
+ ruff check app scripts --fix
scripts:1:1: E902 No such file or directory (os error 2)
Found 1 error.

I think we need to remove
scripts field from format.sh
so it will be:

ruff check app --fix
ruff format app

I can push this small fix if this makes sense.

@patrick91 patrick91 deleted the feature/isort branch November 12, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants