OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to identify the rule that did the format in ruff

  • Thread starter Thread starter lev
  • Start date Start date
L

lev

Guest
I'm running ruff format on my code base,
and not happy with some of the changes.
how can I know which rule is doing the change in order to disable it.

running ruff check returns no errors

here is an example:

original code:

Code:
from pyspark.sql import DataFrame

df: DataFrame = None

df2 = (
    df
    .select("id")
    .filter("id = 1")
)

running ruff check with return:

All checks passed!

but running ruff format will change the file to:

Code:
from pyspark.sql import DataFrame

df: DataFrame = None

df2 = df.select("id").filter("id = 1")

I would like to know which rule removed the parenthesis and refactored to a single like the df2 definition
<p>I'm running <code>ruff format</code>
on my code base,<br />
and not happy with some of the changes.<br />
how can I know which rule is doing the change in order to disable it.</p>
<p>running <code>ruff check</code> returns no errors</p>
<p>here is an example:</p>
<p>original code:</p>
<pre><code>from pyspark.sql import DataFrame

df: DataFrame = None

df2 = (
df
.select("id")
.filter("id = 1")
)
</code></pre>
<p>running <code>ruff check</code> with return:</p>
<blockquote>
<p>All checks passed!</p>
</blockquote>
<p>but running <code>ruff format</code> will change the file to:</p>
<pre><code>from pyspark.sql import DataFrame

df: DataFrame = None

df2 = df.select("id").filter("id = 1")
</code></pre>
<p>I would like to know which rule removed the parenthesis and refactored to a single like the <code>df2</code> definition</p>
 

Latest posts

Top