diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..06863c0b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,60 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Python: secureli --version", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/secureli/main.py", + "cwd": "${workspaceFolder}", + "stopOnEntry": false, + "console": "integratedTerminal", + "justMyCode": true, + "args": ["--version"] + }, + { + "name": "Python: secureli --help", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/secureli/main.py", + "cwd": "${workspaceFolder}", + "stopOnEntry": false, + "console": "integratedTerminal", + "justMyCode": true, + "args": ["--help"] + }, + { + "name": "Python: secureli init", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/secureli/main.py", + "cwd": "${workspaceFolder}", + "stopOnEntry": false, + "console": "integratedTerminal", + "justMyCode": true, + "args": ["init"] + }, + { + "name": "Python: secureli scan", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/secureli/main.py", + "cwd": "${workspaceFolder}", + "stopOnEntry": false, + "console": "integratedTerminal", + "justMyCode": true, + "args": ["scan"] + }, + { + "name": "Python: secureli update", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/secureli/main.py", + "cwd": "${workspaceFolder}", + "stopOnEntry": false, + "console": "integratedTerminal", + "justMyCode": true, + "args": ["update"] + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..e400bd34 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "python.testing.pytestArgs": ["tests"], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} diff --git a/secureli/main.py b/secureli/main.py index 971d76d1..289b8940 100644 --- a/secureli/main.py +++ b/secureli/main.py @@ -28,6 +28,21 @@ def version_callback(value: bool): if value: typer.echo(secureli_version()) + typer.echo("\nHook Versions:") + typer.echo("--------------") + config = container.pre_commit_abstraction().get_pre_commit_config(Path(".")) + + all_repos = [ + (hook.id, repo.rev.lstrip("v")) + for repo in config.repos + for hook in repo.hooks + ] + + sorted_repos = sorted(all_repos, key=lambda x: x[0]) + + for hook_id, version in sorted_repos: + typer.echo(f"{hook_id:<30} {version}") + raise typer.Exit()