jmcs / turnstile Goto Github PK
View Code? Open in Web Editor NEWLocal Git Hooks
License: Apache License 2.0
Local Git Hooks
License: Apache License 2.0
Add a subcommand to open specification for a specific commit. If commit is not provided then it should open the specification of latest one.
This will be particularly useful for custom URIs.
There should be an option to execute a custom command before committing.
Use pkg_resources
to load commands as extension modules. Register current commands as entry points on setup.py
Testing exceptions with doctests doesn't work at the same time in Python 3.4 and Python 2.7, so this tests and other complex ones should be done with py.test
I have activated the codevalidator commit hook for my repository. Now i am receiving the following error on committing:
Traceback (most recent call last):
File "/usr/local/bin/zalando-turnstile-pre-commit", line 9, in <module>
load_entry_point('zalando-turnstile==1.6.1', 'console_scripts', 'zalando-turnstile-pre-commit')()
File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 664, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 644, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File
"/usr/local/lib/python3.4/dist-packages/click/core.py", line 464, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/turnstile/pre_commit.py", line 44, in pre_commit
failed_checks = checks.run_checks('pre-commit', user_configuration, repository_configuration, staging_area)
File "/usr/local/lib/python3.4/dist-packages/turnstile/checks/__init__.py", line 121, in run_checks
result = check(user_configuration, repository_configuration, check_object)
File "/usr/local/lib/python3.4/dist-packages/turnstile/checks/pre_commit/codevalidator.py", line 101, in check
custom_config=codevalidator_rc)
File "/usr/local/lib/python3.4/dist-packages/turnstile/checks/pre_commit/codevalidator.py", line 48, in codevalidator
codevalidator_output = remove_temporary_path(codevalidator_output, temporary_dir)
File "/usr/local/lib/python3.4/dist-packages/turnstile/checks/pre_commit/codevalidator.py", line 69, in remove_temporary_path
lines = [regex.sub('', line, 1) for line in codevalidator_output.splitlines()]
File "/usr/local/lib/python3.4/dist-packages/turnstile/checks/pre_commit/codevalidator.py", line 69, in <listcomp>
lines = [regex.sub('', line, 1) for line in codevalidator_output.splitlines()]
TypeError: can't use a string pattern on a bytes-like object
My .turnstile.yml looks like this:
checks:
- codevalidator
Add an configuration endpoint to allow extensions to be configurable
When using JIRA format for specification check, e.g.
specification:
allowed_format: ['jira']
it would be useful to have a parameter to override/complement default regular expression used for validation.
Example current behaviour :
specification:
allowed_format: ['jira']
"FIRST-42 Feature development" is valid commit message.
"SECOND-42 Feature development" is valid commit message.
Example desired behaviour :
specification:
allowed_format: ['jira']
allowed_schemes: ['FIRST-*']
"FIRST-42 Feature development" is valid commit message.
"SECOND-42 Feature development" is invalid commit message.
It should be easy to upgrade turnstile, for this reason there should be a command that upgrades turnstile to the latests version on pypi.
The command should check it current version is different from the latests version and if not it should use pip to upgrade itself.
There should be a command that runs codevalidator on the repository folder with the repository codevalidatorrc if any.
Specification subcommand to check if a commit range (for example all commits in branch) have a valid specification
Do unit tests to check if the core checks and commands are found.
By moving codevalidator out of the core package makes it possible to use turnstile without having to install codevalidator.
The current package will be renamed turnstile-core
and zalando-turnstile
will be used as a bundle that requires both the core and codevalidator extensions.
Split the specification check to extension module but keep it as an dependency for turnstile-core
The check should prevent commits to master.
Not cool: Writing https://github.com/zalando/turnstile/issues/123
at the beginning of every commit message.
Cool: Writing #123
at the beginning of every commit message. Optional further information (like repository or even full URL) could be placed afterwards in parentheses like #123 (zalando/turnstile)
.
(Of course this depends on the SCM system you're using, should work equally well e.g. for Stash.)
Use pkg_resources
to load checks as extension modules. Register current checks as entry points on setup.py
The commit message should always include the full url\uri as a specification to reduce the complexity.
The specification format should be removed from the configuration as it no longer makes sense.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.