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 an rm-all option to vcs #216

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bergercookie
Copy link
Contributor

@bergercookie bergercookie commented May 26, 2021

As discussed earlier in #195 it would be useful to have an rm-all option whose purpose is to remove the already cloned repositories, as specified by the given YAML file. This is so that the user can potentially clone a new set of dependencies using a new YAML file and not have to manually clean the target directory.

rm-all has a similar interface to import in that it accepts both --input ... as well as input redirection.
It also requires either the -f/--force option or the -n/--dry-run option to actually execute. This is the same behavior as tools such as git clean and its purpose is to avoid a user mistake.

Here are some example usages of the command:

Typical usage:

$ vcs rm-all -f src/  < repos.yaml
Paths to delete:

- src/follow_waypoints
- src/kobuki
$ vcs rm-all -n src/  < repos.yaml
Paths to delete:

- src/follow_waypoints
- src/kobuki

[Dry Run]

Not allowed:

$ vcs rm-all  src/  < repos.yaml
usage: vcs rm-all [-h] [--input FILE_OR_URL] (-n | -f) [path]
vcs rm-all: error: one of the arguments -n/--dry-run -f/--force is required

General thoughts

  • I don't see a straightforward way of doing linting locally and see what errors currently exist in the code to be committed. I think this is inherent to flake8 and its output format IMO which is hard to read and decipher.

    On top of that, there's no reliable tool to correct these errors that I know of. I've been using autopep8 but even after running it and re-formatting my code, it's still not guaranteed that it will pass the flake8 checks since there are edge cases in which auotpep8 doesn't format the code.

    Towards that end, I think it would make sense to switch to a linter like black. It also offers formatting functionalities and in my experience at least, it's rock solid. This way we would also not need a custom python script such as test_flake8.py, since checking the code would be as easy as black --check path/to/file_or_directory.

    Not terribly important, but improvements like this would make developing on the repo a more pleasant experience. What's your take?

  • it would be useful to require a minimum python version of at least 3.6. There are many nice features starting in that version, like pathlib.Path and f-strings, mypy code annotations which would really help.

@bergercookie
Copy link
Contributor Author

@dirk-thomas , friendly ping. :)

@bergercookie
Copy link
Contributor Author

Hi @dirk-thomas ,

Could you take a look at this PR?
I think it would be useful to get this merged or at least get feedback on changes needed in order to get it merged

@bergercookie
Copy link
Contributor Author

@dirk-thomas , friendly ping

@LukeAI
Copy link

LukeAI commented Apr 14, 2023

I'd also like to get this feature, but it looks like there's no active development happening here anymore, could be worth considering PRing to https://github.com/MaxandreOgeret/vcstool2/

@bergercookie
Copy link
Contributor Author

Hi @LukeAI,

I don't currently plan putting more effort in this PR. Do feel free however to port this to the new vcstool2 repo. ;)

@LukeAI
Copy link

LukeAI commented Apr 18, 2023

Hi @LukeAI,

I don't currently plan putting more effort in this PR. Do feel free however to port this to the new vcstool2 repo. ;)

fair enough! thanks, sounds like a good weekend project.

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