Skip to content

Add missing test folders to fmt script - #1459

Merged
tedinski merged 5 commits into
model-checking:mainfrom
celinval:issue-1455-fmt
Aug 10, 2022
Merged

tedinski merged 5 commits into
model-checking:mainfrom
celinval:issue-1455-fmt

Conversation

@celinval

@celinval celinval commented Aug 5, 2022 •

Copy link
Copy Markdown
Contributor

Description of changes:

The format script didn't include all suites that require formatting. I changed the logic to exclude specific folders via rustfmt.toml instead of keeping a list of folders to format.

Resolved issues:

Resolves #1455

Call-outs:

I couldn't find any easy way to make rustfmt ignore a folder that contains their own configuration file (like s2n-quic) submodule inside tests. We should probably not have submodules scattered around our repo, but that's a problem for another day. For now, I am forcing rustfmt to always use the root configuration file when checking tests.

Testing:

  • How is this change tested? N/A

  • Is this a refactor change? No

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@celinval
celinval requested a review from a team as a code owner August 5, 2022 15:41
@fzaiser

fzaiser commented Aug 5, 2022

Copy link
Copy Markdown
Contributor

Wouldn't it make more sense to remove the test files from the ignore list here https://github.com/model-checking/kani/blob/main/rustfmt.toml#L12 instead of formatting them one by one in this script?

@celinval

celinval commented Aug 5, 2022

Copy link
Copy Markdown
Contributor Author

Wouldn't it make more sense to remove the test files from the ignore list here https://github.com/model-checking/kani/blob/main/rustfmt.toml#L12 instead of formatting them one by one in this script?

I believe we still have to format them one by one (AFAIK, you can't run rustfmt on a folder and cargo fmt will not format things out of our workspace). That said, you have a great point when it comes to the right mechanism to implement the ignore logic.

I had forgotten about that file. We haven't really used that. If you look closely, all paths there are related to the rust repo, not ours.

@celinval

celinval commented Aug 6, 2022

Copy link
Copy Markdown
Contributor Author

Note that this was one of the things I was trying to fix here: #1422

Note: I had to use ** wildcard in the ignore section. I believe this may
be related to how rustfmt handle paths when --config-path is used.
@tedinski
tedinski merged commit d9ec642 into model-checking:main Aug 10, 2022
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.

Rust formatting check does not check all files

4 participants