Skip to content

🖌️ adopt dprint #471

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

🖌️ adopt dprint #471

wants to merge 2 commits into from

Conversation

KotlinIsland
Copy link

@KotlinIsland KotlinIsland commented Apr 7, 2025

reviewers note: config/formatting are split across two commits

resolves #393

@guan404ming
Copy link
Member

Thanks @KotlinIsland, LGTM!

Comment on lines +12 to +14
- changed-files:
- any-glob-to-any-file:
- src/numpy-stubs/dtypes.pyi
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why this is 2/6/10, the indentation is set to '2'. it might be a bug in pretty-yaml

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you usually prefer fibonacci indentation, right?

@jorenham
Copy link
Member

jorenham commented Apr 7, 2025

there's a merge conflict

Copy link
Member

@jorenham jorenham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I'm not sure I like the lack of configurability for the toml style, but it's probably better to be more like "black" this way.

@@ -7,7 +7,8 @@
"ms-python.python",
"redhat.vscode-yaml",
"seatonjiang.gitmoji-vscode",
"tamasfe.even-better-toml"
"tamasfe.even-better-toml",
"dprint.dprint"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I may pick a nit; It'd help appease my neuroticism if this were to be sorted alphabetically.

@@ -15,31 +15,31 @@ algebra, basic statistical operations, random simulation and much more.

<div class="grid cards" markdown>

- :material-book-open-variant:{ .lg .middle } &nbsp; __User guide__
- :material-book-open-variant:{ .lg .middle } &nbsp; **User guide**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty neat that it detects markdown in html in markdown

@@ -5,4 +5,4 @@ hide:

# NumType reference

*coming soon*
_coming soon_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit inconsistent with the other __bold__ -> **bold** rule. Can it be changed?

@@ -58,7 +58,7 @@ def f(x: np.floating[NT]) -> np.floating[NT]: ...

///
/// tab | Python 3.12 and above
select: True
select: True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't valid: The leading 4 spaces are part of the syntax:

Lastly, a given Block extension may allow for additional options that don't make sense in the first line declaration. This may be because they are rarely used, more complicated, or just make the first line signature more confusing. These options are per block specific use a YAML syntax. They must be part of the header, which means no new line between the block declaration and the options or between individual options. The options also must be indented at least four spaces.

For instance, all extensions inherit an option attrs which allows you to set HTML attributes to the outer element of a generic block.

/// html | div
    attrs: {style: 'font-size: xx-large'}

Some content.
///

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be deleted, or be made compatible with the dprint toml style

Comment on lines +7 to +8
"PYI015", # flake8-pyi: assignment-default-in-stub
"SIM300", # flake8-pyi: yoda-conditions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"PYI015", # flake8-pyi: assignment-default-in-stub
"SIM300", # flake8-pyi: yoda-conditions
"PYI015", # flake8-pyi: assignment-default-in-stub
"SIM300", # flake8-pyi: yoda-conditions

Comment on lines +6 to +11
"TRY003", # tryceratops: raise-vanilla-args
"TD003", # flake8-todos: missing-todo-link
"S101", # flake8-bandit: assert
"S404", # flake8-bandit: suspicious-subprocess-import
"S603", # flake8-bandit: subprocess-without-shell-equals-true
"T201", # flake8-print: print
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"TRY003", # tryceratops: raise-vanilla-args
"TD003", # flake8-todos: missing-todo-link
"S101", # flake8-bandit: assert
"S404", # flake8-bandit: suspicious-subprocess-import
"S603", # flake8-bandit: subprocess-without-shell-equals-true
"T201", # flake8-print: print
"TRY003", # tryceratops: raise-vanilla-args
"TD003", # flake8-todos: missing-todo-link
"S101", # flake8-bandit: assert
"S404", # flake8-bandit: suspicious-subprocess-import
"S603", # flake8-bandit: subprocess-without-shell-equals-true
"T201", # flake8-print: print

@@ -7,7 +7,8 @@
"ms-python.python",
"redhat.vscode-yaml",
"seatonjiang.gitmoji-vscode",
"tamasfe.even-better-toml"
"tamasfe.even-better-toml",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Suggested change
"tamasfe.even-better-toml",

@@ -7,7 +7,8 @@
"ms-python.python",
"redhat.vscode-yaml",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Suggested change
"redhat.vscode-yaml",

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh won't let me suggest it; but davidanson.vscode-markdownlint can also 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use dprint
3 participants