diff --git a/pre_commit_mirror_maker/all/.pre-commit-hooks.yaml b/pre_commit_mirror_maker/all/.pre-commit-hooks.yaml index 59c39f2..1dcdfec 100644 --- a/pre_commit_mirror_maker/all/.pre-commit-hooks.yaml +++ b/pre_commit_mirror_maker/all/.pre-commit-hooks.yaml @@ -1,5 +1,5 @@ - id: {id} - name: {name} + name: {name!r} description: {description!r} entry: {entry} language: {language} diff --git a/tests/make_repo_test.py b/tests/make_repo_test.py index 2927ac8..eb7e451 100644 --- a/tests/make_repo_test.py +++ b/tests/make_repo_test.py @@ -94,6 +94,33 @@ def test_arguments(in_git_dir): }] +def test_arguments_name_with_special_chars(in_git_dir): + _commit_version( + '.', + version='1.0.0', language='node', + name='@bugron/validate-dependabot-yaml', + description='', entry='validate-dependabot-yaml', + id='validate-dependabot-cli', + match_key='files', + match_val=r'^(\.github|config)/dependabot\.ya?ml$', args='[]', + additional_dependencies='[]', require_serial='false', + minimum_pre_commit_version='0', + ) + contents = in_git_dir.join('.pre-commit-hooks.yaml').read() + assert yaml.safe_load(contents) == [{ + 'id': 'validate-dependabot-cli', + 'name': '@bugron/validate-dependabot-yaml', + 'description': '', + 'entry': 'validate-dependabot-yaml', + 'language': 'node', + 'files': r'^(\.github|config)/dependabot\.ya?ml$', + 'args': [], + 'require_serial': False, + 'additional_dependencies': [], + 'minimum_pre_commit_version': '0', + }] + + @pytest.fixture def fake_versions(): fns = {'ruby': lambda _: ('0.23.1', '0.24.0', '0.24.1')}