Closed CuriousLearner closed 5 years ago
This is what i got after fresh install, i didn't much in the details yet. But i guess this much should be helpful to move forward if anyone wants to take a look or for future references.
is not of type 'array'
/Users/theskumar/work/venv/lib/python3.7/site-packages/pre_commit/clientlib/validate_base.py:46: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
obj = load_strategy(file_contents)
An error has occurred: InvalidConfigError: Invalid content: .pre-commit-config.yaml
{'repos': [{'repo': 'git://github.com/pre-commit/pre-commit-hooks', 'rev': 'v1.4.0', 'hooks': [{'id': 'flake8'}, {'id': 'end-of-file-fixer'}, {'id': 'trailing-whitespace'}, {'id': 'check-case-conflict'}, {'id': 'check-merge-conflict'}, {'id': 'check-yaml'}, {'id': 'detect-private-key'}, {'id': 'forbid-new-submodules'}, {'id': 'check-json'}, {'id': 'pretty-format-json'}, {'id': 'check-added-large-files'}, {'id': 'double-quote-string-fixer'}, {'id': 'fix-encoding-pragma'}]}, {'repo': 'git://github.com/CuriousLearner/pre-commit-python-sorter', 'sha': '5294cde9d51cff119af537e987c30c320e9fbe2f', 'hooks': [{'id': 'python-import-sorter', 'args': ['--silent-overwrite']}]}]} is not of type 'array'
Failed validating 'type' in schema:
{'items': {'properties': {'hooks': {'items': {'properties': {'additional_dependencies': {'items': {'type': 'string'},
'type': 'array'},
'always_run': {'type': 'boolean'},
'args': {'items': {'type': 'string'},
'type': 'array'},
'exclude': {'type': 'string'},
'files': {'type': 'string'},
'id': {'type': 'string'},
'language_version': {'type': 'string'}},
'required': ['id'],
'type': 'object'},
'minItems': 1,
'type': 'array'},
'repo': {'type': 'string'},
'sha': {'type': 'string'}},
'required': ['repo', 'hooks'],
'type': 'object'},
'minItems': 1,
'type': 'array'}
On instance:
{'repos': [{'hooks': [{'id': 'flake8'},
{'id': 'end-of-file-fixer'},
{'id': 'trailing-whitespace'},
{'id': 'check-case-conflict'},
{'id': 'check-merge-conflict'},
{'id': 'check-yaml'},
{'id': 'detect-private-key'},
{'id': 'forbid-new-submodules'},
{'id': 'check-json'},
{'id': 'pretty-format-json'},
{'id': 'check-added-large-files'},
{'id': 'double-quote-string-fixer'},
{'id': 'fix-encoding-pragma'}],
'repo': 'git://github.com/pre-commit/pre-commit-hooks',
'rev': 'v1.4.0'},
{'hooks': [{'args': ['--silent-overwrite'],
'id': 'python-import-sorter'}],
'repo': 'git://github.com/CuriousLearner/pre-commit-python-sorter',
'sha': '5294cde9d51cff119af537e987c30c320e9fbe2f'}]}
Check the log at ~/.pre-commit/pre-commit.log
Let me check it.
lets close https://github.com/Fueled/django-init/pull/166 when this PR is deployed :)
@saurabh-fueled Updated the branch with master and I'm able to run the pre-commit hooks by generating a new project.
Can you please test it once on your end? If everything is fine, we can merge this!
Thanks!
@CuriousLearner The issue is the precommit version. use pre-commit==1.16.1
everything should work fine
There are few more updated versions post 1.16.1
but the config file is not compatible to those changes.
Hey @vikalpj
I can update the version, but I'm able to run the hooks with 1.15.2
Okay, error on my side. I should've tried it on using the version added in this PR. I will update the version.
@CuriousLearner the version in the PR is 0.8.2 added in commit https://github.com/Fueled/django-init/blob/e9a94b23fe4ca639c548f9c3657ef191da1d09dd/%7B%7Bcookiecutter.github_repository%7D%7D/requirements/development.txt#L33
@vikalpj Yeah noticed that from your previous comment. Updated it.
Add pre-commit-hooks for better code quality
Enforces code quality checks
None.