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

Sorting of some tables seems to be random #206

Closed
edgarrmondragon opened this issue May 12, 2024 · 2 comments
Closed

Sorting of some tables seems to be random #206

edgarrmondragon opened this issue May 12, 2024 · 2 comments

Comments

@edgarrmondragon
Copy link
Contributor

edgarrmondragon commented May 12, 2024

Consider the following pyproject.toml:

[tool.ruff]
line-length = 88
src = [
  "src",
  "tests",
  "docs",
]

[tool.ruff.format]
docstring-code-format = true
preview = true

[tool.ruff.lint]
preview = true
select = [
  "F",
  "E",
  "W",
  "EM",
  "PD",
]

[tool.ruff.lint.per-file-ignores]
"src/*" = [
  "PD", # pandas-vet
]

[tool.ruff.lint.flake8-errmsg]
max-string-length = 30

Running pyproject-fmt (2.0.3) against it produces different results on sequential runs. I used the --check flag to confirm the randomness (as opposed to the result being affected by any previous changes made by the tool).

The following command was used then

pyproject-fmt --check pyproject.toml 

Example 1

--- pyproject.toml

+++ pyproject.toml

@@ -10,6 +10,8 @@

 docstring-code-format = true
 preview = true
 
+[tool.ruff.lint.flake8-errmsg]
+max-string-length = 30
 [tool.ruff.lint]
 preview = true
 select = [
@@ -24,6 +26,3 @@

 "src/*" = [
   "PD", # pandas-vet
 ]
-
-[tool.ruff.lint.flake8-errmsg]
-max-string-length = 30

Example 2

--- pyproject.toml

+++ pyproject.toml

@@ -6,10 +6,8 @@

   "docs",
 ]
 
-[tool.ruff.format]
-docstring-code-format = true
-preview = true
-
+[tool.ruff.lint.flake8-errmsg]
+max-string-length = 30
 [tool.ruff.lint]
 preview = true
 select = [
@@ -25,5 +23,6 @@

   "PD", # pandas-vet
 ]
 
-[tool.ruff.lint.flake8-errmsg]
-max-string-length = 30
+[tool.ruff.format]
+docstring-code-format = true
+preview = true

Example 3

No changes 😅

$ pyproject-fmt --check pyproject.toml
no change for pyproject.toml

Let me know if this better reported in https://github.com/tox-dev/pyproject-fmt-rust :)

@gaborbernat
Copy link
Member

Yeah I think this is tox-dev/pyproject-fmt-rust#8

@edgarrmondragon
Copy link
Contributor Author

edgarrmondragon commented May 13, 2024

Ah this is probably a duplicate of #205 and both are now fixed by #210.

EDIT: both are probably duplicate of #201

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

No branches or pull requests

2 participants