-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Disable some rule in format
#8206
Comments
Thanks for the feedback. I close this as a duplicate. Would you mind upvoting (reacting) to this issue #7525 that asks for a new option to skip string normalization |
Thanks @MichaReiser for pointing that issue. But that is just one of it. I love ruff previous fix that support which rule to use and which is not. I would like that the formatter follow or at least provide some functionality when user don't want to implement specific format. Thus, not only skipping string normalization, but any formatter. |
Oh I see and can understand that it is unlikely that we agree with all decisions the formatter makes for us. For now, we don't plan to add as granular configuration options as YAPF. We may want to consider implementing different code styles eventually discussion. Also see this comment from @charliermarsh that gives some more context. |
Thanks @MichaReiser, I've finished read that discussion and comment. But, my concern is far more simple than that. I just, not ready, to follow all rule or implement all format. Just let me choose which one while transitioning from This world should not be black and white. Committing to one fully. Just, just, let me chose which formatter (not library, like one that is already implemented that is to sort import or not), that I want ruff to implement. And this should be easy to maintain and or test, because, just "ignore formatting x". More like, If not rule this: continue to next rule |
Implementing partial formatting, e.g. based on the type of node isn't trivial because the formatting rules depend on each other. The formatting of binary expressions makes assumptions about how the operands will format. This knowledge is required to ensure that the formatted code doesn't contain any syntax errors. |
I see. So, each format is already designed to depend on each other, thus implementing and testing just one rule at a time is not trivial task. Thanks for clarifying. But, I hope this kind of functionality will come. If it indeed implemented by ruff, I can be sure that every sane person will use ruff, at least some of its rule and did not need to worry to be forced to use all format or rule. Thank you. |
You're welcome |
I finally went to try ruff today (it's been on my list for a while). But the formatter is a non-starter without configurable rules. I understand that some are tied to each other and more difficult to implement, but others should be easier to ignore. In my case, removing the |
I'm using ruff 0.1.1. With the newest feature, we can use
ruff format .
Asautopep8
user, I don't want to implement all ruff format. Just some of it. For example, I want something like 'quote-style = "none"` to not implement that rule.That is because I use single quote for variable and word, but double quote for sentence and paragraphs.
Thank you.
The text was updated successfully, but these errors were encountered: