Skip to content

Format project - #3

Closed
JetVolcano wants to merge 1 commit into
jg-rp:mainfrom
JetVolcano:main
Closed

Format project#3
JetVolcano wants to merge 1 commit into
jg-rp:mainfrom
JetVolcano:main

Conversation

@JetVolcano

@JetVolcano JetVolcano commented Jun 10, 2026

Copy link
Copy Markdown
  • Used ruff format . to format the python files.
  • Formated tests/grammars/*.pest files to improve readability.

Use ruff format . to format the python project
@jg-rp

jg-rp commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Hi @JetVolcano,

Those three Python files are automatically generated every time we run pytest (they all say "This file was generated by Python Pest..." at the top). So formatting them with ruff is not going to last long.

Rather than trying to guess what formatting rules a user might want, the current policy is to generate whatever comes naturally from pest.condegen.Builder and assume the user will run the output through their own formatter (I don't want to force a Ruff dependency on everyone).

Otherwise those .pest files in tests/grammars/ are deliberately copied verbatim from https://github.com/pest-parser/pest. I consider the formatting of those files part of the test.

@JetVolcano JetVolcano closed this Jun 11, 2026
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

Successfully merging this pull request may close these issues.

2 participants