Designer and Engineer, Product Development at Mytos
Current experience... Javascript, Typescript, React, Node.js, Heroku, AWS, Docker, MQTT (PubSub), Raspberry Pi
Past experience... Python, C/C++, Java
a tool for writing conventional commits, conveniently
License: GNU General Public License v3.0
Provide GitHub guidance for using keywords.
https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords
Potential solutions:
Colouring when the footer input box continues is not intuitive.
Update the colour palette of the tool. Colour support, compatibility and 'fallbacks' need to be checked then doing this.
The check for updates looks at the github tags rather than PyPI. This means it can suggest updating before update has been deployed to PyPI.
Many fields save history to allow up arrow key to reuse recently used commands.
This would be useful to be extended to the "Extra args" field for adding to the commit command.
Example is: forgetting --no-verify
and typing everything out, then needing to restart.
To support co-authors on GitHub, the following trailer needs to be added to the commit
Co-authored-by: Firstname Lastname <[email protected]>
Additional features:
nebbles@gh
and gitcommit automatically detects and attempts to resolve the public email from the GitHub profile page (and possibly full name?)Input
Update DevicesContainer for react-hooks
output
Update devicescontainer for react-hooks
Often find I missed --no-verify
Would be good if a commit could be reattempted but with the flag added
Distribute the command as a brew package?
UPDATE: Required checklist:
The config directory is being created for every directory the tool runs in.
It is not correctly interpreting the ~ symbol for home path.
Each composer should hold a history to the previous entries into that particular composer. That way aborted commits can be recalled and partially restored easier.
This tool should be callable by using the command git cc
This is possible by simply adding an executable to your path such as git-refresh
to create git refresh
. See these articles for reference [1] [2]
Modify pyproject.toml
as follows
[tool.poetry.scripts]
gitcommit = "gitcommit.gitcommit:main"
+ git-cz = "gitcommit.gitcommit:main"
The tool is building to the level that it desperately needs tests to be able to ensure things don't break when adding new features.
Unsure on how to handle prompt input though.
From @PA17
Traceback (most recent call last):
File "/usr/local/bin/gitcommit", line 6, in <module>
from gitcommit.gitcommit import main
File "/usr/local/lib/python3.7/site-packages/gitcommit/gitcommit.py", line 39, in <module>
from .completers import TypeCompleter, FooterCompleter
File "/usr/local/lib/python3.7/site-packages/gitcommit/completers.py", line 1, in <module>
from prompt_toolkit.completion import ( # pylint: disable=no-name-in-module
ImportError: cannot import name 'FuzzyCompleter' from 'prompt_toolkit.completion' (/usr/local/lib/python3.7/site-packages/prompt_toolkit/completion/__init__.py)
Accepted types have been updated in the company guidelines. Perhaps this should be externalised to the tool so templates can be built for a company/worflow specific person or repository?
When checking current version against latest fetch-able version, it incorrectly evaluates which version takes precedence.
Example
Commit has been made to conventional commits standards!
There is an update available for conventional-commit.
Version 0.3.0 โ 0.2.8
Added to your clipboard: pip install --upgrade conventional-commit
The readme needs to be updated with better information on the features available.
There should be a per project config to define acceptable scopes. Without this, as observed in some company repos, they become random and sporadic. Defining scopes is a sensible step towards ensuring they are used properly.
Currently use Travis. Should review whether CircleCI or GitHub actions are better options.
If the current terminal window is less that 80 characters, a reminder should pop up to suggest that the user expands it to at least 80 characters (to show line wrapping properly).
Network exception was thrown when checking for updates. This should be refactored to show more useful errors related to networking.
Note that this was already emergency patched in 6f426d1.
Traceback below (submitted by @PA17)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 588, in urlopen
conn = self._get_conn(timeout=pool_timeout)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 248, in _get_conn
return conn or self._new_conn()
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 826, in _new_conn
raise SSLError("Can't connect to HTTPS URL because the SSL "
urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/nebbles/gitcommit/tags (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/gitcommit", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/gitcommit/gitcommit.py", line 396, in main
run()
File "/usr/local/lib/python3.7/site-packages/gitcommit/gitcommit.py", line 391, in run
check_for_update()
File "/usr/local/lib/python3.7/site-packages/gitcommit/updater.py", line 37, in check_for_update
tags = get_github_tags()
File "/usr/local/lib/python3.7/site-packages/gitcommit/updater.py", line 12, in get_github_tags
resp = requests.get("https://api.github.com/repos/nebbles/gitcommit/tags")
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/nebbles/gitcommit/tags (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
Tool should recognise when it is out of date and suggest an update pip upgrade conventional-commit
Even when pre-commit hooks reject the commit, a success message is shown to the user
Add a command such as gitcommit check "message"
that will check the contents of the string to ensure that it is CC compliant.
Would be useful to print just the files staged for commit at the start of the commit process.
Probably should be toggle-able in the future in a preferences file.
Alternative means to entering new lines in a multi-line text entry (currently Enter
, preceded by Esc
if you want to submit).
Option 1 (closest to current):
Enter
will submit the field as empty. [existing]Enter
will add a new line return. [existing]Esc
immediately preceding Enter
will mean field is submitted. [existing]Cmd+Enter
shortcut will submit the field without need for Esc
key. [new]Shift+Enter
shortcut will submit the field too? [new]Option 2:
Enter
key will always submit the field.Shift+Enter
to add new line return.Configuration file could allow setting preference for this behaviour.
Salavat, on Windows:
9 wip Any code changes that are work in progress; they may not build (use these sparingly!)
Traceback (most recent call last):
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\eventloop\context.py", line 89, in get
return self._storage[ctx]
KeyError: 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\output\defaults.py", line 58, in get_default_output
value = _default_output.get()
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\eventloop\context.py", line 91, in get
raise TaskLocalNotSetError
prompt_toolkit.eventloop.context.TaskLocalNotSetError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\user1\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\user1\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\User1\AppData\Local\Programs\Python\Python37\Scripts\gitcommit.exe\__main__.py", line 7, in <module>
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\gitcommit\gitcommit.py", line 396, in main
run()
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\gitcommit\gitcommit.py", line 352, in run
commit_msg = add_type(commit_msg)
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\gitcommit\gitcommit.py", line 143, in add_type
ANSI(text), completer=TypeCompleter(), validator=TypeValidator(valid_inputs),
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\shortcuts\prompt.py", line 903, in prompt
session = PromptSession(input=input, output=output, history=history)
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\shortcuts\prompt.py", line 344, in __init__
output = output or get_default_output()
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\output\defaults.py", line 67, in get_default_output
return create_output()
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\output\defaults.py", line 41, in create_output
return Win32Output(stdout)
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\output\win32.py", line 99, in __init__
info = self.get_win32_screen_buffer_info()
File "c:\users\user1\appdata\local\programs\python\python37\lib\site-packages\prompt_toolkit\output\win32.py", line 194, in get_win32_screen_buffer_info
raise NoConsoleScreenBufferError
prompt_toolkit.output.win32.NoConsoleScreenBufferError: Found xterm, while expecting a Windows console. Maybe try to run this program using "winpty" or run it in cmd.exe instead. Or otherwise, in case of Cygwin, use the Python executable that is compiled for Cygwin.
Depending on project language, there may be various places where a version bump would be desired. In the first instance this should be configured in a config file unique to this tool.
Perhaps there is scope to add options for integrating the config into native config files such as pyproject.toml
for Python projects.
Update dependencies and build system to use Poetry
The tool needs a new independent (of gitcommit
) name
CLI control should be enhanced. The current proposal is to introduce a number of flags to customise the visual experience of the tool (such as verbose / minimal), and to implement larger additional features as commands.
An example can be seen from woile/commitizen
$ cz --help
usage: cz [-h] [--debug] [-n NAME] [--version]
{ls,commit,c,example,info,schema,bump} ...
Commitizen is a cli tool to generate conventional commits.
For more information about the topic go to https://conventionalcommits.org/
optional arguments:
-h, --help show this help message and exit
--debug use debug mode
-n NAME, --name NAME use the given commitizen
--version get the version of the installed commitizen
commands:
{ls,commit,c,example,info,schema,bump}
ls show available commitizens
commit (c) create new commit
example show commit example
info show information about the cz
schema show commit schema
bump bump semantic version based on the git log
config
used to generate, possibly modify repo specific configurationversion <major|minor|patch>
allows single command to increase version numbersexample
shows some examples of the output of the toolhelp
provides guidance on the use of the toolcheck
(#18) lints the input string to see if it adheres to standardsformat
takes a string as input and does its best to auto format to standardshelp
shows help messageversion
shows version of packageverbose
more contextual information given to the committerminimal
reduce interface to bare minimumno-colour
removes colour component from formatted textspell-check
would open message in editor at end to allow for spell checkingAdd support for skip ci in git commit messages.
Will need to check how different tools (Travis, Circle, etc) work to skip ci. Hopefully they do not require it to be in the first line, and will accept it being in the footer where it should be.
URLs if they cause a line to exceed its maximum length should be moved onto their own line. The URL on that line should remain unbroken (it may exceed the line limit).
Should efforts be merged with existing project https://github.com/Woile/commitizen
A major overhaul is needed. Currently the approach is functional, but already it is getting messy and the need for globals is pressing. Moving to a class based system could be a way out. Or a major revamp of the functional approach is necessary.
Important changes needed as part of this rework:
Add pre-commit hooks for things such as black.
A keyboard shortcut is needed to go back through the questions/stages in case an error was made.
Update to cleanse input and format to company standards. Examples:
"
cannot be used anywhere in message as it will break message when sent to command line.Success message is shown even when no files were staged for commit. This means that no commit is actually made, although exit code is 0
so we don't detect it.
The following input
Tool will now check for updates posted as tag to the GitHub repository against the
current version of the tool. This check runs every time the tool completes the final
confirmation question.
was reformatted to
Tool will now check for updates posted as tag to the github repository
against the current version of the tool. this check runs every time the
tool completes the final confirmation question.
Accepted types and other preferences could be set on a global, or probably better, per-project basis in some config file.
existing proj for reference: https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional
It would be good to tidy up the prompt after each input stage. Long lists explanations etc wouldn't be shown and a formatted result of what you input would be shown.
Check questionary source to see how they implemented it.
Support for the bulleted list (of markdown variety using *
or -
) should be added to the body input stage.
Requirements for this enhancement are
*
or -
must be recognised as bullet point characters if they are at the start of a new line. The character must be converted to one of the two as standard (which is yet to be determined).Support for spell checking
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.