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(ci): enforce workspace lints in crate tomls #1922

Merged

Conversation

dorimedini-starkware
Copy link
Collaborator

No description provided.

@dorimedini-starkware dorimedini-starkware self-assigned this Nov 10, 2024
@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Nov 10, 2024

Codecov Report

Attention: Patch coverage is 82.85714% with 6 lines in your changes missing coverage. Please review.

Project coverage is 85.24%. Comparing base (e3165c4) to head (dbedf35).
Report is 320 commits behind head on main.

Files with missing lines Patch % Lines
workspace_tests/lints_test.rs 78.57% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1922       +/-   ##
===========================================
+ Coverage   40.10%   85.24%   +45.14%     
===========================================
  Files          26        3       -23     
  Lines        1895      122     -1773     
  Branches     1895      122     -1773     
===========================================
- Hits          760      104      -656     
+ Misses       1100       14     -1086     
+ Partials       35        4       -31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)


workspace_tests/lints_test.rs line 15 at r1 (raw file):

    assert!(
        crates_without_lints.is_empty(),
        "The following crates are missing a [lints] section: {crates_without_lints:?}."

More prty, also below

Suggestion:

        "The following crates are missing a [lints] section: {crates_without_lints:#?}."

workspace_tests/version_integrity_test.rs line 36 at r1 (raw file):

        let crate_paths: Vec<String> = crate_cargo_toml.path_dependencies().collect();
        all_path_deps_in_crate_tomls.extend(crate_paths);
    }

maybe

Suggestion:

ROOT_TOML
        .member_cargo_tomls()
        .values()
        .flat_map(|toml| toml.path_dependencies())
        .collect()

workspace_tests/toml_utils.rs line 89 at r1 (raw file):

            .iter()
            .map(|member| {
                let cargo_toml_path = Path::new(&crates_dir).join(member).join("Cargo.toml");

Path is a slice

Suggestion:

        let crates_dir = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/../"));
        self.members()
            .iter()
            .map(|member| {
                let cargo_toml_path = crates_dir.join(member).join("Cargo.toml");

Copy link
Contributor

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)

@dorimedini-starkware dorimedini-starkware force-pushed the dori/enforce-workspace-lints-in-crate-tomls branch from 3886137 to dbedf35 Compare November 12, 2024 10:09
Copy link
Contributor

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)

@dorimedini-starkware dorimedini-starkware merged commit 6b3bd58 into main Nov 12, 2024
10 checks passed
@dorimedini-starkware dorimedini-starkware deleted the dori/enforce-workspace-lints-in-crate-tomls branch November 12, 2024 10:28
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.

3 participants