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

Prepended whitespace in trailing comment #706

Closed
VeckoTheGecko opened this issue Nov 29, 2024 · 2 comments
Closed

Prepended whitespace in trailing comment #706

VeckoTheGecko opened this issue Nov 29, 2024 · 2 comments

Comments

@VeckoTheGecko
Copy link

VeckoTheGecko commented Nov 29, 2024

version: 0.9.3

Take the following trimmed down pyproject.toml file:

test = [
  "default:Duplicate dimension names present:UserWarning:xarray.namedarray.core",
  "default:::xarray.tests.test_strategies", # test
]

Running the formatter gives:

test = [
  "default:Duplicate dimension names present:UserWarning:xarray.namedarray.core",
  "default:::xarray.tests.test_strategies",                                       # test
]

Playing with the "default:Duplicate dimension names ... line gives different results (differing amount of whitespace, or just correct formatting in some cases).


Search terms:

  • format comment

couldn't find a duplicate :/

VeckoTheGecko added a commit to VeckoTheGecko/xarray that referenced this issue Nov 29, 2024
@panekj
Copy link
Collaborator

panekj commented Nov 29, 2024

align_comments https://taplo.tamasfe.dev/configuration/formatter-options.html

pj@delsin ~/test> taplo fmt -o align_comments=true - < test.toml
 INFO taplo:format_stdin:load_config: found configuration file path="/home/pj/test/.taplo.toml"
test = [
  "default:Duplicate dimension names present:UserWarning:xarray.namedarray.core",
  "default:::xarray.tests.test_strategies",                                       # test
]
pj@delsin ~/test> taplo fmt -o align_comments=false - < test.toml
 INFO taplo:format_stdin:load_config: found configuration file path="/home/pj/test/.taplo.toml"
test = [
  "default:Duplicate dimension names present:UserWarning:xarray.namedarray.core",
  "default:::xarray.tests.test_strategies", # test
]

VeckoTheGecko added a commit to VeckoTheGecko/xarray that referenced this issue Nov 29, 2024
@VeckoTheGecko
Copy link
Author

OHHHH. Thank you!

@VeckoTheGecko VeckoTheGecko closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2024
max-sixty pushed a commit to pydata/xarray that referenced this issue Dec 3, 2024
* add taplo pre-commit hook

* move TODO

tamasfe/taplo#706

* add validate-pyproject pre-commit hook
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