conventional_commits 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 773e8500d2a910d271e21c329b6b2341c93929e86b6a35310abe967bb9a701e8
4
- data.tar.gz: 34910f2e6067b60c823a2e4f8f1aa6ce6d44472ac47d65ce63de5d22c6119f1a
3
+ metadata.gz: e6ae6b0c24851cd4187e486f651d0e4d9771976ff141916308d7af9ebdc04dcb
4
+ data.tar.gz: 89e014f037a44a66af16de22d1ef343f98628e7872e79391fad3b342bc5b23f4
5
5
  SHA512:
6
- metadata.gz: d5af3444a122c72e7946064d490393ff4ed774acc8f6e6e8d22adac7852bebabc173fd98da25c0790826a63d156048b6ab93dd36fcce2f5dc2ea1227c849438a
7
- data.tar.gz: 291379e49c6ac188ec384987b92a43dbaae811694304b0ac92e9c4994390b5cf452a477fc8e30f46a5d6eb1210550271f06682a71352360eeb1ff10f3dfc14e2
6
+ metadata.gz: 20c152762ded992258897e4f7d5a72ea9fa737aea6a47151f43d890f308bb2d193fca2b4bc57d3930b9ef74af04128cecc5fae770c03fe1afc6fe552cdc9574d
7
+ data.tar.gz: 0eaa4b6db66729c636cd540ca7fdf98a411b0d99016d373556948586bffcb07be6fc7c378139e3e813a7a26c29a82df3cce91942f0e6f986133d3afccd926b92
@@ -0,0 +1,23 @@
1
+ branch:
2
+ lowercase: true
3
+ ticket_prefix: JIRA
4
+ pattern: <type>/<ticket>/<description>
5
+ type:
6
+ feat: [ feature, feat ]
7
+ fix: [ bug, bugfix, fix ]
8
+ ci: [ ci ]
9
+ refactor: [ ref, refactor, refactoring ]
10
+ doc: [ doc, doc, documentation ]
11
+ release:
12
+ rules:
13
+ - types:
14
+ - ref
15
+ - fix
16
+ version: patch
17
+ - types:
18
+ - feature
19
+ version: patch
20
+ - type: breaking
21
+ version: major
22
+
23
+
data/Gemfile CHANGED
@@ -5,8 +5,8 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in conventional_commits.gemspec
6
6
  gemspec
7
7
 
8
+ gem "gem-release"
8
9
  gem "rake", "~> 13.0"
9
10
  gem "rspec", "~> 3.0"
10
11
  gem "rubocop", "~> 1.21"
11
12
  gem "simplecov"
12
-
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- conventional_commits (0.1.0)
4
+ conventional_commits (0.1.1)
5
5
  open3
6
6
  thor
7
7
  yaml
@@ -47,6 +47,7 @@ GEM
47
47
  diff-lcs (1.5.1)
48
48
  docile (1.4.0)
49
49
  ffi (1.16.3)
50
+ gem-release (2.2.2)
50
51
  json (2.7.1)
51
52
  language_server-protocol (3.17.0.3)
52
53
  mini_mime (1.1.5)
@@ -107,6 +108,7 @@ DEPENDENCIES
107
108
  aruba
108
109
  conventional_commits!
109
110
  cucumber
111
+ gem-release
110
112
  rake (~> 13.0)
111
113
  rspec (~> 3.0)
112
114
  rubocop (~> 1.21)
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # ConventionalCommits
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/conventional_commits`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This gem contains several tools to help enforce conventional commits practices.
4
+ It contains CLI as well as Modules that you can you for your own use cases.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
6
 
7
7
  ## Installation
8
8
 
@@ -16,7 +16,48 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
16
 
17
17
  ## Usage
18
18
 
19
- TODO: Write usage instructions here
19
+ Be mindful that this gem is mostly made for a specific set of practices. The idea is a team is agreed on specific branch name practices. This will help automating commits and templates thus helping developer to avoid redundant work.
20
+
21
+ For easy start you can create a file `.conventional_commits/config.yml` with the next structure
22
+ run hooks installer by calling:
23
+
24
+ $ conventional_commits install_hooks
25
+
26
+ ```yaml
27
+ branch:
28
+ lowercase: true
29
+ ticket_prefix: JIRA
30
+ pattern: <type>/<ticket>/<description>
31
+ type:
32
+ feat: [ feature, feat ]
33
+ fix: [ bug, bugfix, fix ]
34
+ ci: [ ci ]
35
+ refactor: [ ref, refactor, refactoring ]
36
+ doc: [ doc, doc, documentation ]
37
+ release:
38
+ rules:
39
+ - types:
40
+ - ref
41
+ - fix
42
+ version: patch
43
+ - types:
44
+ - feature
45
+ version: patch
46
+ - type: breaking
47
+ version: major
48
+
49
+ ```
50
+
51
+ ### Options
52
+ - `lowercase` - will make sure that the branch name is in lowercase when cli `conventional_commit branch <NAME>` is called
53
+ to create a new branch
54
+ - `ticket_prefix` - is used to append prefix to the commit message at the footer
55
+ - `pattern` - is used to define the separators between in future it will be used to define the order as well
56
+ - `type` - is used for mapping combination of short names for the type of request. Helps to avoid inconsistency.
57
+
58
+ ### Release
59
+ Not implemented yet. It will contain tools to increment version number based on the rules
60
+
20
61
 
21
62
  ## Development
22
63
 
@@ -26,4 +67,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
26
67
 
27
68
  ## Contributing
28
69
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/conventional_commits.
70
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Swift-Gurus/conventional_commits.
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "cli/branch_name_cli"
4
+ require "branch/branch_name_generator"
5
+ require "configuration/branch_configuration_reader"
6
+ require "configuration/main_configuration_reader"
7
+ require "models/main_configuration"
8
+ require "models/release_configuration"
9
+ require "models/release_rule"
10
+ require "models/branch_configuration"
11
+ require "configuration"
12
+ require "models/type_configuration"
13
+ require "commit/commit_message_generator"
14
+ require "git/git"
15
+ require "conventional_commits"
16
+ require "helpers/file_extension"
17
+ require "commit/commit_message_parser"
18
+ require "commit/commit_message_validator"
19
+ require "hooks/hooks_installer"
20
+ ConventionalCommits::BranchNameCLI.start(ARGV)
data/lib/configuration.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ConventionalCommits
4
4
  module Configuration
5
- DEFAULT_CONFIGURATION_PATH = ".conventional_commit/config.yaml"
5
+ DEFAULT_CONFIGURATION_PATH = ".conventional_commits/config.yml"
6
6
  DEFAULT_COMMIT_MSG_PATH = ".git/COMMIT_EDITMSG"
7
7
  DEFAULT_COMMIT_BODY_TEMPLATE = "[Describe your work, and put an empty string after]"
8
8
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConventionalCommits
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -54,7 +54,7 @@ module ConventionalCommits
54
54
  end
55
55
 
56
56
  def cli_command(cmd)
57
- "bundle exec bin/conventional_commit #{cmd}"
57
+ "bundle exec conventional_commits #{cmd}"
58
58
  end
59
59
 
60
60
  def ruby_eval
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conventional_commits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swift-Gurus
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-21 00:00:00.000000000 Z
11
+ date: 2024-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open3
@@ -96,10 +96,12 @@ dependencies:
96
96
  version: '0'
97
97
  description: Enforces conventional commits specs.
98
98
  email: alexei.hmelevski@gmail.com
99
- executables: []
99
+ executables:
100
+ - conventional_commits
100
101
  extensions: []
101
102
  extra_rdoc_files: []
102
103
  files:
104
+ - ".conventional_commits/config.yml"
103
105
  - ".rspec"
104
106
  - ".rubocop.yml"
105
107
  - Gemfile
@@ -107,6 +109,7 @@ files:
107
109
  - README.md
108
110
  - Rakefile
109
111
  - conventional_commits.gemspec
112
+ - exe/conventional_commits
110
113
  - lib/branch/branch_name_generator.rb
111
114
  - lib/cli/branch_name_cli.rb
112
115
  - lib/commit/commit_message_generator.rb