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

Check subdirectories #8

Merged
merged 1 commit into from Jun 26, 2022
Merged

Check subdirectories #8

merged 1 commit into from Jun 26, 2022

Conversation

kitagry
Copy link
Contributor

@kitagry kitagry commented Jun 25, 2022

relate #6

❯ cargo run -- .
./sql/subquery_with_binary_op.sql:5:19: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
./sql/subquery_with_between.sql:6:6: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
./sql/subquery_with_between_from.sql:5:24: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery
./sql/subquery_with_between_to.sql:6:6: Full scan will cause! Should not compare _TABLE_SUFFIX with subquery

Copy link
Owner

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

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

@kitagry Thanks for your contribution! I added a comment. plz check.

src/main.rs Outdated
.map(|ref mut file| analyse_sql(file))
.expect("failed to open file"),
.flat_map(|f| {
WalkDir::new(f).into_iter().filter_map(|e| e.ok()).map(
Copy link
Owner

@hirosassa hirosassa Jun 25, 2022

Choose a reason for hiding this comment

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

Maybe we should filter items whose extension is not .sql, IMO.
Currently, bqvalid works correctly because analyse_sql() ignores non-sql files, but it is not intentional.

I think following feature is useful for it.
https://docs.rs/walkdir/latest/walkdir/struct.FilterEntry.html

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry for the late reply. I fixed it!

Copy link
Owner

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

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

@kitagry Looks GREAT! Thanks!

@hirosassa hirosassa merged commit 6a730a6 into hirosassa:main Jun 26, 2022
@kitagry kitagry deleted the dirwalk branch June 26, 2022 11:41
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