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

Add include flag #11

Open
albertofavaro opened this issue May 29, 2018 · 3 comments
Open

Add include flag #11

albertofavaro opened this issue May 29, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@albertofavaro
Copy link

When considering which files to sync, it would be useful to have an include flag as well as the current ignore flag. The list of file types that I plan to include is quite minimal (.py, .md and perhaps .sh). Having an include flag would cater for people who use sml-sync mostly to develop Python.

@janfreyberg
Copy link
Contributor

Thanks @albertofavaro - just to check, what would you expect the behaviour to be in the following cases:

  1. --include="*.py" --ignore="secrets.py"
  2. --include="test.py, test2.py" --ignore="test.py"

I think 1. should work and the ignore should supersede the include, and 2. should raise an error, but would be good to know what you expect to happen. I think given that you can specify ignore arguments in the config, it could be easy to have clashes.

@pbugnion
Copy link
Contributor

pbugnion commented May 30, 2018

Thanks for raising this! Once we've settled on a behaviour, happy to walk you -- or anyone else interested in working on this -- through the steps to get this implemented!

@albertofavaro
Copy link
Author

I don't have a strong opinion. I would suggest that the flag --include is a filter that gets applied before the flag --ignore. With this logic, neither of the examples that @janfreyberg put forward would result in an error. They would be interpreted as:

  1. All .py files with the exception of secrets.py are considered.
  2. The file test2.py is considered, whereas test.py is not.

@srstevenson srstevenson added the enhancement New feature or request label Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

4 participants