- Notifications
You must be signed in to change notification settings - Fork0
💻 XConventional is a cli tool to generate conventional commits and versioning
License
NotificationsYou must be signed in to change notification settings
danroxha/xconv
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Expired Study Project onCommittizen
- [Git]
^2.
+
Run in your terminal
xchelp
or the shortcut
xc h
- output
NAME: xc - X Conventional is a cli tool to generate conventional commits and versioning.USAGE: xc [-h] {init,commit,example,info,tag,schema,bump,changelog,version}AUTHOR: Rocha da Silva, Daniel <rochadaniel@acad.ifma.edu.br>COMMANDS: init, i init xconv configuration commit, c create new commit changelog, ch generate changelog (note that it will overwrite existing file) bump, b bump semantic version based on the git log rollback, r revert commit to a specific tag tag, t show tags schema, s show commit schema example, e show commit example version, v get the version of the installed xconv or the current project help, h Shows a list of commands or help for one commandGLOBAL OPTIONS: --help, -h show help (default: false)COPYRIGHT: (c) 2022 MIT
xc commit
or the shortcut
xc c
xc rollback
or the shortcut
xc r
xc tag
or the shortcut
xc t
Select the tag for rollback and confirm
rule:changelog_file:CHANGELOG.mdactive_profile:xconv_defaultprofiles: -name:xconv_defaultextends:niltag:restricted:truemode:standardformat:v$versionbump:map:'BREAKING CHANGE':MAJORfeature:MINORbugfix:PATCHhotfix:PATCHpattern:^(BREAKING[\-\ ]CHANGE|feature|hotfix|docs|bugfix|refactor|perf)(\(.+\))?(!)?changelog_pattern:^(feature|bugfix|hotfix|perf|refactor)?(!)?change_type_map:feature:Featurebugfix:Bugfixhotfix:Hotfixperf:Performancedocs:Documentationrefactor:Refactorchange_type_order: -BREAKING[\-\ ]CHANGE -feature -bugfix -hotfix -refactor -perfcommit_parser:^(?P<change_type>docs|feature|bugfix|hotfix|refactor|perf|BREAKING CHANGE)(?:\((?P<scope>[^()\r\n]*)\)|\()?(?P<breaking>!)?:\s(?P<message>.*)version_parser:(?P$version([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?(\w+)?)schema_pattern:(build|ci|docs|feature|bugfix|hotfix|perf|refactor|style|test|chore|revert|bump):(\(\S+\))?!?:(\s.*)schema:| <prefix>(<scope>): <subject> <BLANK LINE> <body> <BLANK LINE> (BREAKING CHANGE: <footer> ) <footer>example:| bugfix: correct minor typos in code see the work item for details on the typos fixed related work items #12info:This is default info from xconvinfo_path:xconv_info.txtmessage_template:| {{prefix}}({{scope}}): {{subject}} {% if body != '' %} {{body}} {% endif %} {% if is_breaking_change %} BREAKING CHANGE: {% endif %} {% if footer != '' %} Related work items: #{{footer}} {% endif %}questions: -type:listmessage:"Select the type of change you are committing:"name:prefixchoices: -value:featurekey:fname:"feature: A new feature." -value:bugfixname:"bugfix: A bug fix. Correlates with PATCH in SemVer"key:b -value:hotfixname:"hotfix: A bug fix in PROD"key:h -value:docsname:"docs: Documentation only changes"key:d -value:stylename:"style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"key:s -value:refactorname:"refactor: A code change that neither fixes a bug nor adds a feature"key:r -value:perfname:"perf: A code change that improves performance"key:p -value:testname:"test: Adding missing or correcting existing tests"key:t -value:chorename:"chore: Changes to configuration files (example scopes: .gitignore, .xconv.yaml)"key:z -value:buildname:"build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)"key:x -value:ciname:"ci: Changes to our CI configuration files and scripts (example scopes: AzureDevOps)"key:c -type:inputmessage:"What is the scope of this change? (class or file name): (press [enter] to skip):"name:scopemiddleware: -to lower case -trimfilter:is empty -type:inputmessage:"Write a short and imperative summary of the code changes: (lower case and no period):"name:subjectmiddleware: -to lower case -trimfilter:is empty -type:inputmessage:"Provide additional contextual information about the code changes: (press [enter] to skip):"name:bodymiddleware: -to lower case -type:confirmname:is_breaking_changemessage:"Is this a BREAKING CHANGE? Correlates with MAJOR in SemVer (press [enter] to skip):"default:false -type:inputmessage:"Related work items (PBI, Task IDs, Issue): (press [enter] to skip)"name:footermiddleware: -to lower casescript:filters: -name:is emptyretry:trueenable:truemessage:content:"[ALERT]: this field cannot be empty or only contain spaces"color:truescript:| function run(argument) return argument == nil or argument == '' endmiddlewares: -name:to lower caseenable:truescript:| function run(argument) return string.lower(argument) end -name:trimenable:truescript:| function run(argument) return (string.gsub(argument, "^%s*(.-)%s*$", "%1")) endtasks: -name:push current tagenable:truelanguage:shbind:bumpwhen:afterscript:| CURRENT_TAG=$(xc tag current --format=%V) git push origin $CURRENT_TAG
rule:changelog_file:CHANGELOG.mdactive_profile:alpha profileprofiles: -name:alpha profileextends:xconv_defaulttag:stamp:xconvmode:alpha# alpha beta | default: standardformat:v$version# v$major.$minor.$patch$"message_template:| {{prefix}}({{scope}}): {{subject}} {% if body != '' %} {{body}} {% endif %} {% if is_breaking_change %} BREAKING CHANGE: {% endif %} {% if footer != '' %} issue: {{footer}} {% endif %}script:tasks: -name:log bumpenable:truelanguage:shbind:bumpwhen:afterscript:| CURRENT_TAG=$(xc tag current --format=%V) if [ ! -e log-version.txt ] then echo $CURRENT_TAG > log-version.txt exit fi echo $CURRENT_TAG >> log-version.txt -name:remote scriptenable:truelanguage:shbind:examplewhen:afterscript:| TMP=".xconv/tmp" if [ -e $TMP/lazy.sh ] then ./$TMP/lazy.sh --version exit fi mkdir -p $TMP wget https://raw.githubusercontent.com/dannRocha/lazy/master/lazy.sh -qO $TMP/lazy.sh chmod +x $TMP/lazy.sh echo "-- Remote script:" ./$TMP/lazy.sh --version # remove this command to enable 'cache' rm -fr .xconv
Rule
Variable Type Default implemented Description changelog_file string CHANGELOG.md ❌ active_profile string xconv_default ✔️ profiles list<profile> ✔️ Profile
Variable Type Default implemented Description name string xconv_default ✔️ extends string nil ✔️ tag object ✔️ bump object ✔️ changelog_pattern string ^(feature|bugfix|hotfix|perf|refactor)?(!)? ❌ change_type_map map<string, string> { feature: Feature, bugfix: Bugfix, hotfix: Hotfix, perf: Performance, docs: Documentation, refactor: Refactor } ❌ change_type_order list<string> BREAKING[-\ ]CHANGE, feature, bugfix, hotfix, refactor, perf ❌ commit_parser string ^(?P<change_type>docs|feature|bugfix|hotfix|refactor|perf|BREAKING CHANGE)(?:\((?P[^()\r\n]))|()?(?P!)?:\s(?P.) ❌ version_parser string (?P$version([0-9]+).([0-9]+).([0-9]+)(?:-\([0-9A-Za-z-]+(?:.[0-9A-Za-z-]+)*))?(?:+[0-9A-Za-z-]+)?(\w+)?) ✔️ schema_pattern string (build|ci|docs|feature|bugfix|hotfix|perf|refactor|style|test|chore|revert|bump):\(\(\S+))?!?:\(\s.*) ❌ schema string <prefix>(<scope>): <subject><BLANK LINE>
<body>
<BLANK LINE>(BREAKING CHANGE: <footer> )<footer>✔️ example string bugfix(main.go): correct minor typos in code
see the work item for details on the typos fixed
related work items #12✔️ info string xconv_default ✔️ info_path string xconv_default ✔️ message_template string {{prefix}}({{scope}}): {{subject}}
{% if body != '' %}{{body}}{% endif %}
{% if is_breaking_change %}
BREAKING CHANGE:
{% endif %}
{% if footer != '' %}
Related work items: #{{footer}}
{% endif %}✔️ questions list ✔️ Tag
Variable Type Default implemented Description stamp string xconv ✔️ mode string standard ✔️ format object v$version ✔️ Bump
Variable Type Default implemented Description map map<string, string> {'BREAKING CHANGE': MAJOR, feature: MINOR, bugfix: PATCH, hotfix: PATCH } ✔️ pattern string "^(BREAKING[- ]CHANGE|feature|hotfix|docs|bugfix|refactor|perf)((.+))?(!)?" ✔️ Questions
Variable Type Default implemented Description type string list|input
✔️ message string ✔️ name string ✔️
script
Variable Type Default implemented Description filter list<filter> ✔️ middleware list<middleware> ✔️ task list<task> ✔️ filter
Variable Type Default implemented Description name string ✔️ retry boolean false ✔️ enable boolean false ✔️ message object ✔️ script string ✔️ middleware
Variable Type Default implemented Description name string ✔️ enable boolean false ✔️ script string ✔️ task
Variable Type Default implemented Description name string ✔️ enable boolean false ✔️ language string lua
✔️ bind string ✔️ when string after
✔️ script string ✔️
About
💻 XConventional is a cli tool to generate conventional commits and versioning
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published