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

refactor: format source code using nightly rustfmt #1567

Draft
wants to merge 2 commits into
base: v1.0-dev
Choose a base branch
from

Conversation

lklimek
Copy link
Contributor

@lklimek lklimek commented Nov 7, 2023

Issue being fixed or feature implemented

We need to unify code formatting.

What was done?

This PR adds .rustfmt.toml file to the repo that defines formatting of Rust code.

  1. Created .rustfmt.toml that defines code formatting policy
  2. Configured github actions to run using +nightly
  3. Run cargo +nightly fmt
  4. Updated docs

How Has This Been Tested?

cargo +nightly fmt

Breaking Changes

Will cause tons of conflicts.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

cache: false

- name: Check formatting
run: exit `cargo fmt --check --package=${{ inputs.package }} | wc -l`
run: exit `cargo +nightly fmt --check --package=${{ inputs.package }} | wc -l`
Copy link
Member

@shumkov shumkov Nov 22, 2023

Choose a reason for hiding this comment

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

How is it going to work since we are still on stable channel and my IDE formats changed files automatically? I can't define a toolbox for formating there. Shall we just wait until this feature becomes stable?

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.

None yet

2 participants