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

Enable recursive directory traversal in casc #21

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

dburgener
Copy link
Owner

This enables recursively discovering all policy files in the specified
path(s), which is expected to be the most common use case.

Additional ergonomics, like defaulting to CWD if no path is specified is
future work.

src/bin/casc.rs Outdated Show resolved Hide resolved
@dburgener dburgener force-pushed the dburgener/recursive-file-discovery branch from f036a88 to 911afd6 Compare May 10, 2022 16:04
@l0kod
Copy link
Collaborator

l0kod commented May 27, 2022

I'd prefer to sort the list of inserted/walked paths (not necessarily the list of argument paths) to get consistent behavior whatever the underlying files/filesystem/host.

@l0kod
Copy link
Collaborator

l0kod commented May 27, 2022

Updating the documentation and the casc's help with this new usage would be useful too.

src/bin/casc.rs Outdated Show resolved Hide resolved
src/bin/casc.rs Outdated Show resolved Hide resolved
@dburgener
Copy link
Owner Author

dburgener commented May 27, 2022

I'd prefer to sort the list of inserted/walked paths (not necessarily the list of argument paths) to get consistent behavior whatever the underlying files/filesystem/host.

You mean sort the return from output of get_policy_files()?

@dburgener dburgener force-pushed the dburgener/recursive-file-discovery branch from 911afd6 to 442937f Compare May 27, 2022 17:48
@dburgener
Copy link
Owner Author

I pushed an update, but the only issues I've addressed so far are rebasing on the latest merges and switching from println!() to eprintln!(). I'll look more closely at the rest next week.

@dburgener dburgener force-pushed the dburgener/recursive-file-discovery branch from 442937f to 2e3daa1 Compare May 31, 2022 19:26
@dburgener dburgener force-pushed the dburgener/recursive-file-discovery branch from 2e3daa1 to 1d4e886 Compare June 14, 2022 15:07
@dburgener
Copy link
Owner Author

CI breakage is due to clap. It looks like they're making this breakage opt-in in an upcoming PR: clap-rs/clap#3830

src/bin/casc.rs Show resolved Hide resolved
src/bin/casc.rs Show resolved Hide resolved
This enables recursively discovering all policy files in the specified
path(s), which is expected to be the most common use case.

Additional ergonomics, like defaulting to CWD if no path is specified is
future work.
@dburgener dburgener force-pushed the dburgener/recursive-file-discovery branch from 1d4e886 to 88d01a4 Compare June 14, 2022 17:13
@l0kod
Copy link
Collaborator

l0kod commented Jun 14, 2022

It would be nice to add a test calling casc (with another PR).

@dburgener dburgener merged commit c6b1fc4 into main Jun 14, 2022
@dburgener dburgener deleted the dburgener/recursive-file-discovery branch June 14, 2022 17:20
@dburgener
Copy link
Owner Author

It would be nice to add a test calling casc (with another PR).

Yes, although I don't think that there's a clean way to do that in the current unit test framework, so we'd need to add some other test framework for it. That's fine, but it's more work, and lower priority than library testing IMO, so it may not be immediately forthcoming.

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.

2 participants