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

add rustfmt support #1902

Merged
merged 11 commits into from Feb 9, 2024
Merged

add rustfmt support #1902

merged 11 commits into from Feb 9, 2024

Conversation

Dangerise
Copy link
Contributor

@Dangerise Dangerise commented Feb 5, 2024

implement #1901

closes #1906

@ealmloff
Copy link
Member

ealmloff commented Feb 5, 2024

It looks like cargo fmt errors are getting captured somewhere without warning the user.

With this code:

fn main() {

Running dx fmt --rustfmt gives no output and does not format the code
Running cargo fmt gives this warning:

 --> /../testing/src/main.rs:1:12
  |
1 | fn main() {
  |           -^
  |           |
  |           unclosed delimiter

@Dangerise
Copy link
Contributor Author

@ealmloff

I've got some problems about dx fmt

dx-fmt

In the gif above , dx was built from crates.io, dx-git was built from github

also, I try to print out the files that dx fmt found, I found it empty.

image

@Dangerise
Copy link
Contributor Author

  • replace gitignore with ignore crate
  • rewrite autoformat_project with rayon
  • use prettyplease as formatter

@Dangerise
Copy link
Contributor Author

fixed #1906

packages/cli/src/error.rs Outdated Show resolved Hide resolved
@Dangerise
Copy link
Contributor Author

@ealmloff updated

Copy link
Member

@ealmloff ealmloff left a comment

Choose a reason for hiding this comment

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

I pushed a few changes to make error reporting better and rename the rustfmt flag, other than that this looks good, thank you!

@ealmloff ealmloff merged commit 0a4603d into DioxusLabs:master Feb 9, 2024
8 of 9 checks passed
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.

[CLI] using archived crate: gitignore.rs
2 participants