Skip to content

Conversation

@casperdcl
Copy link
Contributor

@casperdcl casperdcl commented May 31, 2020

ye moste beautiful autogeneration of autocompletion

  • auto-generate completion/dvc.bash based on dvc.cli use iterative/shtab to generate completions
    • add dvc completion [-s {bash,zsh}] [-f FILE] [{dir}] subcommand
    • add choices=(Required|Optional).DVC_FILE custom completion
    • add _dvc_compgen_dirs for e.g. output paths of get/import use choices=(Required|Optional).(FILE|DIR) custom completion
      • introduce consistency calling DVC-files targets and other files paths? not required Required to choose between _dvc_compgen_files and _dvc_compgen_DVCFiles
      • double-check the current changes
        • exclude some hidden/beta commands?
  • make snap build its own completions
  • add CI tests
  • potentially drop _dvc_compgen_files for get/get-url/import shtab API offers separate completion of different args (i.e. don't complete url, but complete dirs for output path)
  • potentially remove completion/dvc.bash altogether
  • sort out completion/dvc.zsh too
  • permanently puts tab completion scripts need more love #2985 to bed by loving really hard
  • depends on alpha release shtab#2

much bash such python

follow-up tasks

  • add pre-commit hook not needed as completions are dynamically generated now
  • introduce consistency calling DVC-files targets, other files paths, and directories dirs
  • introduce consistency around leading vs trailing whitespace when linebreaking strings
  • update documentation completion: update installation instructions dvc.org#1447

@casperdcl casperdcl requested a review from efiop May 31, 2020 23:11
@casperdcl casperdcl self-assigned this May 31, 2020
@casperdcl casperdcl added ci enhancement Enhances DVC refactoring Factoring and re-factoring research testing Related to the tests and the testing infrastructure ui user interface / interaction labels Jun 1, 2020
@efiop efiop requested review from pared, pmrowla and skshetry June 2, 2020 04:44
@casperdcl
Copy link
Contributor Author

ready for review now. The DeepSource test can be ignored (shell="bash"/"zsh" is mistakenly viewed as a security issue, likely due to confusion with Popen(shell=True))

@efiop efiop merged commit fa0f182 into iterative:master Jun 19, 2020
@efiop
Copy link
Contributor

efiop commented Jun 19, 2020

This is great. Thank you @casperdcl !

@casperdcl casperdcl mentioned this pull request Jun 19, 2020
5 tasks
@casperdcl
Copy link
Contributor Author

Sure; feel free to add to #4070 with inevitable teething issues.

@shcheklein shcheklein mentioned this pull request Jun 19, 2020
5 tasks
casperdcl added a commit to casperdcl/dvc that referenced this pull request Jun 21, 2020
- makes help output look the same as before iterative#3921
@casperdcl casperdcl mentioned this pull request Jun 21, 2020
5 tasks
efiop pushed a commit that referenced this pull request Jun 21, 2020
* command: add metavars

- makes help output look the same as before #3921

* deps: update shtab version

Part of #4070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhances DVC refactoring Factoring and re-factoring research testing Related to the tests and the testing infrastructure ui user interface / interaction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants