-
-
Notifications
You must be signed in to change notification settings - Fork 29
Add Rust mirrors #34
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 Rust mirrors #34
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| /.idea | ||
| /.project | ||
| /.pydevproject | ||
| /.pytest_cache | ||
| /.tox | ||
| /.venv.touch | ||
| /venv* | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ | |
| language: {language} | ||
| '{match_key}': {match_val} | ||
| args: {args} | ||
| additional_dependencies: {additional_dependencies} | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [package] | ||
| name = "__fake_crate" | ||
| version = "0.0.0" | ||
|
|
||
| [[bin]] | ||
| name = "__fake_cmd" | ||
| path = "main.rs" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It turns out you can't really make a noop So this builds a bogus executable which does nothing. Maybe okay? An alternative could be to make pre-commit's Rust support allow repos with no
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is probably fine, we have to do the same dance for |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| fn main() {{}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,7 @@ def test_commit_version(in_git_dir): | |
| '.', | ||
| version='0.24.1', language='ruby', name='scss-lint', entry='scss-lint', | ||
| match_key='files', match_val=r'\.scss$', args='[]', | ||
| additional_dependencies=[], | ||
| ) | ||
|
|
||
| # Assert that our things got copied over | ||
|
|
@@ -84,6 +85,7 @@ def test_arguments(in_git_dir): | |
| '.', | ||
| version='0.6.2', language='python', name='yapf', entry='yapf', | ||
| match_key='files', match_val=r'\.py$', args='["-i"]', | ||
| additional_dependencies=['scikit-learn'], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol you troll |
||
| ) | ||
| contents = in_git_dir.join('.pre-commit-hooks.yaml').read() | ||
| assert yaml.safe_load(contents) == [{ | ||
|
|
@@ -93,6 +95,7 @@ def test_arguments(in_git_dir): | |
| 'language': 'python', | ||
| 'files': r'\.py$', | ||
| 'args': ['-i'], | ||
| 'additional_dependencies': ['scikit-learn'], | ||
| }] | ||
|
|
||
|
|
||
|
|
@@ -213,3 +216,24 @@ def test_python_integration(in_git_dir): | |
| subprocess.check_call((sys.executable, 'setup.py', 'egg_info')) | ||
|
|
||
| # TODO: test that the package is installable | ||
|
|
||
|
|
||
| @pytest.mark.integration | ||
| def test_rust_integration(in_git_dir): | ||
| make_repo( | ||
| '.', | ||
| language='rust', name='shellharden', entry='shellharden', | ||
| match_key='types', match_val='shell', args='["--replace"]', | ||
| ) | ||
| # Our files should exist | ||
| assert in_git_dir.join('.version').exists() | ||
| assert in_git_dir.join('.pre-commit-hooks.yaml').exists() | ||
| assert in_git_dir.join('Cargo.toml').exists() | ||
| assert in_git_dir.join('main.rs').exists() | ||
|
|
||
| # Should have made _some_ tags | ||
| assert _cmd('git', 'tag', '-l') | ||
| # Should have made _some_ commits | ||
| assert _cmd('git', 'log', '--oneline') | ||
|
|
||
| # TODO: test that the package is installable | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How important is the
minimum_pre_commit_versionkey? Is it worth doing some hackery to get it in for projects which haveadditional_dependencies?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not all that important, it's not exactly a new feature (and will fail for other reasons) 😆