-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_infra_utils: check for unused imports in cairo0 format test #11911
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
base: main
Are you sure you want to change the base?
Conversation
6c5587f to
42bb427
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yoni-Starkware made 1 comment.
Reviewable status: 0 of 29 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware).
crates/apollo_infra_utils/src/cairo0_compiler.rs line 213 at r1 (raw file):
/// Returns the content with unused imports removed. #[cfg(any(test, feature = "testing"))] pub fn remove_unused_cairo0_imports(content: &str) -> String {
PLZ accept the magic and don't review this function @dorimedini-starkware
3e4f2ed to
466efc1
Compare
dorimedini-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dorimedini-starkware reviewed 28 files and all commit messages, and made 4 comments.
Reviewable status: 28 of 29 files reviewed, 5 unresolved discussions (waiting on @Yoni-Starkware).
crates/apollo_infra_utils/src/cairo0_compiler.rs line 0 at r2 (raw file):
can you (in a separate PR) split into cairo0_compiler.rs and cairo0_compiler_test_utils.rs? I see a lot of cfgs
crates/apollo_infra_utils/src/cairo0_compiler.rs line 214 at r2 (raw file):
#[cfg(any(test, feature = "testing"))] pub fn remove_unused_cairo0_imports(content: &str) -> String { use regex::Regex;
move to top
Code quote:
use regex::Regex;crates/apollo_infra_utils/src/cairo0_compiler.rs line 321 at r2 (raw file):
#[cfg(any(test, feature = "testing"))] fn is_import_used(import_item: &str, code: &str) -> bool { use regex::Regex;
move to top
Code quote:
use regex::Regex;crates/apollo_infra_utils/src/cairo0_compiler.rs line 380 at r2 (raw file):
// Remove unused imports after formatting and sorting. remove_unused_cairo0_imports(&isort_content)
don't you want to run this before formatting? it can effect line breaks
Code quote:
// Remove unused imports after formatting and sorting.
remove_unused_cairo0_imports(&isort_content)
No description provided.