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

feat: scarb fmt a subdirectory #1626

Merged
merged 11 commits into from
Oct 3, 2024
Merged

Conversation

enitrat
Copy link
Contributor

@enitrat enitrat commented Oct 2, 2024

Allows formatting a single file. Useful for integration with external tools.

Closes #1534

Copy link
Contributor

@maciektr maciektr 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 contributing! 👏

@enitrat
Copy link
Contributor Author

enitrat commented Oct 2, 2024

Pushed a commit to avoid emitting the file path in emit mode. Behvaior is similar to foundry.

However I have an issue: it seems that in emit mode, the output has an extra empty line at the end. I can't find where this originates from?

This causes issues when used in combination with other checkers

@enitrat
Copy link
Contributor Author

enitrat commented Oct 2, 2024

However I have an issue: it seems that in emit mode, the output has an extra empty line at the end. I can't find where this originates from?

I think it's just that get_formatted_file auto-inserts an empty line at EOF ?

@enitrat enitrat changed the title feat: scarb fmt a single file feat: scarb fmt a subdirectory Oct 2, 2024
@enitrat
Copy link
Contributor Author

enitrat commented Oct 2, 2024

Pushed a version that works fine when integrated with Trunk :)

@enitrat enitrat force-pushed the feat/scarb-fmt branch 2 times, most recently from 42d4b27 to 3441a1f Compare October 3, 2024 09:18
Copy link
Contributor

@maciektr maciektr left a comment

Choose a reason for hiding this comment

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

Looks good to me! 😄
Thanks so much for your contribution! ❤️

@maciektr maciektr added this pull request to the merge queue Oct 3, 2024
Merged via the queue into software-mansion:main with commit daa03c3 Oct 3, 2024
22 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.

feat: scarb fmt option to target a specific file.
3 participants