git-markdown 0.1.8 → 0.1.9

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: 06b5aeed8786c57bb26b159375e7dcbb449e12b2ef4068f5aade847e1ffb809b
4
- data.tar.gz: 3c60e2b038a66ca27183e27c54efba8bc05a0cd0395f3c9ce6f735e401840702
3
+ metadata.gz: 76a5b1c374e3b1570dbc81b878c599fbe4948bb82f34ac3e7b83b838fba9f8fa
4
+ data.tar.gz: e59928ca3d2c0e06662c1c3bd5de7a9e6a8dd08fe185107902442a9dc96644aa
5
5
  SHA512:
6
- metadata.gz: d5156133e179f31b2271f67caed36f9d90dfc0404cb25134097ae6a208861249959f6a3c4aefa7f1f7649d5f1ab25db11fb352de6bd2c11df8962139b2d2c327
7
- data.tar.gz: cbd01023d035fea4d1f82759e8d829d645ddbcbbf40fa8d5acaf5eff1a777861a9566d2c13dd078efe1abbe3995abd00b2d1e6ba8d9c3f2e364eebf5ae0aae2d
6
+ metadata.gz: 06eca733ed11a7e397f050a3e12080c0354e12c4fe1f760dec9e0237a919e5eaa4d5b65af451356ffceed818c095d0829908f5feb0df0b7eac2b5408e34bb5ff
7
+ data.tar.gz: 0545bb27e46d36a396c5963fbefc4f37a9c00b96ae275872cb0c959e9b3724aa994dc0078c58c900d0b8594f0ba035d4749d876d48d6cb2ac7db286dc62327b2
data/AGENT.md ADDED
@@ -0,0 +1,47 @@
1
+ # Agent Guide
2
+
3
+ Repository-specific rules for code-generation agents working on `git-markdown`.
4
+
5
+ ## Core workflow
6
+
7
+ - Prefer surgical edits. Do not reformat unrelated code or reshuffle files.
8
+ - Read the actual call sites and CLI flows before changing behavior.
9
+ - Preserve the public CLI and generated Markdown shape unless the task explicitly requires a change.
10
+ - Fix root causes, not symptoms.
11
+ - Keep one canonical owner per behavior:
12
+ - remote parsing in `Git::Markdown::RemoteParser`
13
+ - auth/config in `Git::Markdown::Configuration` and `Git::Markdown::Credentials`
14
+ - provider fetching in `Git::Markdown::Providers::*`
15
+ - HTTP transport/response handling in `Git::Markdown::Api::*`
16
+ - output rendering in `Git::Markdown::Markdown::Generator`
17
+
18
+ ## Naming and code quality
19
+
20
+ - Use one canonical term per concept across code, config, and docs.
21
+ - Do not add parallel wrappers or aliases for the same concept.
22
+ - Use clear names that describe the domain object or action; avoid vague names like `Manager`, `Helper`, or `Handler`.
23
+ - Keep classes small and intention-revealing. If logic starts spanning transport, parsing, and rendering concerns, split by responsibility rather than adding conditionals.
24
+ - Fail fast on unexpected states. Prefer explicit errors over silent fallbacks.
25
+ - When tests are hard to write, simplify the production design first instead of adding test-only indirection.
26
+
27
+ ## Testing and boundaries
28
+
29
+ - Framework: Minitest.
30
+ - Keep WebMock enabled. Do not allow live HTTP in tests.
31
+ - Use VCR for outbound GitHub API interactions when fixtures are needed.
32
+ - Add or update minimal tests when behavior changes, especially for CLI output, parsing, and provider interactions.
33
+ - Use `standardrb` for Ruby style consistency.
34
+ - Run `bundle exec rake` before finishing.
35
+
36
+ ## Git commits and release
37
+
38
+ - Conventional Commits are required and enforced by `commitlint`.
39
+ - Allowed commit types for normal work: `feat`, `fix`, `refactor`, `chore`, `test`, `docs`.
40
+ - Subject line: imperative, <= 80 chars, no trailing period.
41
+ - Add a body for non-trivial changes explaining why and how.
42
+ - Install hooks once per clone: `bundle exec lefthook install`
43
+ - Release flow:
44
+ - `bundle exec rake 'release:prepare[patch]'`
45
+ - changelog is generated by `git-cliff`
46
+ - publishing happens only in GitHub Actions
47
+ - this gem publishes only to RubyGems
data/CHANGELOG.md CHANGED
@@ -5,9 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.1.8] - 2026-03-20
8
+ ## [0.1.9] - 2026-04-21
9
9
 
10
- ### <!-- 0 -->šŸš€ Features
11
- - filter GitHub-native resolved comments via GraphQL
10
+ ### <!-- 1 -->šŸ› Bug Fixes
11
+ - publish built gem in release workflow
12
+
13
+
14
+ ### <!-- 3 -->šŸ“š Documentation
15
+ - update gemspec and readme
16
+
17
+
18
+ ### <!-- 7 -->āš™ļø Miscellaneous Tasks
19
+ - standardize gem release workflow and repo conventions
20
+ - stop using github variables
12
21
 
13
22
 
data/Gemfile CHANGED
@@ -5,8 +5,6 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in git-markdown.gemspec
6
6
  gemspec
7
7
 
8
- gem "gem-release", "~> 2.2"
9
-
10
8
  group :development do
11
9
  gem "commitlint", require: false
12
10
  gem "lefthook", require: false
data/README.md CHANGED
@@ -130,7 +130,7 @@ Note: `Gemfile.lock` is intentionally not tracked to avoid conflicts across Ruby
130
130
 
131
131
  ### Git hooks
132
132
 
133
- We use [lefthook](https://lefthook.dev/) with the Ruby [commitlint](https://github.com/arandilopez/commitlint) gem to enforce Conventional Commits on every commit. CI also validates commit messages on pull requests and pushes to main/master.
133
+ We use [lefthook](https://lefthook.dev/) with the Ruby [commitlint](https://github.com/arandilopez/commitlint) gem to enforce Conventional Commits on every commit. We also use [Standard Ruby](https://standardrb.com/) to keep code style consistent. CI validates commit messages, Standard Ruby, tests, and git-cliff changelog generation on pull requests and pushes to main/master.
134
134
 
135
135
  Run the hook installer once per clone:
136
136
 
@@ -146,27 +146,29 @@ rake install
146
146
 
147
147
  ## Release
148
148
 
149
- Releases are triggered by pushed tags and use `CHANGELOG.md` for GitHub release notes.
149
+ Releases are tag-driven and published by GitHub Actions to RubyGems. Local release commands never publish directly.
150
150
 
151
- If you want changelog automation, install `git-cliff` (<https://github.com/orhun/git-cliff>) locally and use it to update `CHANGELOG.md`.
151
+ Install [git-cliff](https://git-cliff.org/) locally before preparing a release. The release task regenerates `CHANGELOG.md` from Conventional Commits.
152
152
 
153
- The release workflow expects a `## [X.Y.Z]` entry in `CHANGELOG.md` that matches the tag. Note: `release:prep` enforces a clean working tree and must run on the `main` or `master` branch; it will skip if the changelog has no changes.
153
+ Before preparing a release, make sure you are on `main` or `master` with a clean worktree.
154
154
 
155
- Before bumping, install dependencies:
155
+ Then run one of:
156
156
 
157
157
  ```bash
158
- bundle install
158
+ bundle exec rake 'release:prepare[patch]'
159
+ bundle exec rake 'release:prepare[minor]'
160
+ bundle exec rake 'release:prepare[major]'
161
+ bundle exec rake 'release:prepare[0.1.0]'
159
162
  ```
160
163
 
161
- Then run:
164
+ The task will:
162
165
 
163
- ```bash
164
- # 1) Bump the version (commit created)
165
- bundle exec gem bump -v X.Y.Z
166
+ 1. Regenerate `CHANGELOG.md` with `git-cliff`.
167
+ 1. Update `lib/git/markdown/version.rb`.
168
+ 1. Commit the release changes.
169
+ 1. Create and push the `vX.Y.Z` tag.
166
170
 
167
- # 2) Prepare release (changelog + tag + push)
168
- bundle exec rake release:prep
169
- ```
171
+ The `Release` workflow then runs tests, publishes the gem to RubyGems, and creates the GitHub release from the changelog entry.
170
172
 
171
173
  ## Contributing
172
174
 
@@ -199,7 +201,7 @@ MIT License, see [LICENSE.txt](LICENSE.txt)
199
201
 
200
202
  ## About
201
203
 
202
- Made by the team at [Ethos Link](https://www.ethos-link.com) — practical software for growing businesses. We build tools for hospitality and retail teams who don’t have time for complicated setups: plain-language insights, fast onboarding, and real human support so you can get clear insights, take action, and move on.
204
+ Made by the team at [Ethos Link](https://www.ethos-link.com) — practical software for growing businesses. We build tools for hospitality operators who need clear workflows, fast onboarding, and real human support.
203
205
 
204
- We also build [Reviato](https://www.reviato.com), ā€œMore stars. Less hassle.ā€.
205
- Reviato helps restaurants, hotels, clinics, vets and other local businesses collect and analyse customer reviews, highlights recurring themes, and turns feedback into actionable next steps.
206
+ We also build [Reviato](https://www.reviato.com), ā€œCapture. Interpret. Act.ā€.
207
+ Turn guest feedback into clear next steps for your team. Collect private appraisals, spot patterns across reviews, and act before small issues turn into public ones.
data/Rakefile CHANGED
@@ -1,89 +1,99 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Note: Releases are handled automatically by GitHub Actions when you push a tag (e.g., v0.2.0)
4
- # See .github/workflows/release.yml for details
5
3
  require "bundler/gem_tasks"
6
4
  require "rake/testtask"
7
5
  require "standard/rake"
8
6
  require_relative "lib/git/markdown/version"
9
7
 
8
+ VERSION_PATH = File.expand_path("lib/git/markdown/version.rb", __dir__)
9
+ VALID_RELEASE_TARGETS = %w[major minor patch].freeze
10
+
10
11
  Rake::TestTask.new(:test) do |t|
11
12
  t.libs << "test"
12
13
  t.libs << "lib"
13
14
  t.test_files = FileList["test/**/*_test.rb"]
14
15
  end
15
16
 
16
- task default: %i[test standard]
17
+ def current_branch
18
+ `git branch --show-current`.strip
19
+ end
17
20
 
18
- namespace :release do
19
- desc "Full release: update changelog, bump version, commit, tag, and push"
20
- task :bump, [:level] do |_t, args|
21
- level = args[:level] || "patch"
22
- valid_levels = %w[major minor patch pre]
21
+ def clean_worktree?
22
+ system("git diff --quiet") && system("git diff --cached --quiet")
23
+ end
24
+
25
+ def release_version(target)
26
+ target = target.to_s.strip
27
+ raise ArgumentError, "Provide patch, minor, major, or an explicit X.Y.Z version." if target.empty?
28
+
29
+ return target if target.match?(/\A\d+\.\d+\.\d+\z/)
30
+
31
+ unless VALID_RELEASE_TARGETS.include?(target)
32
+ raise ArgumentError, "Invalid release target #{target.inspect}. Use #{VALID_RELEASE_TARGETS.join(", ")} or X.Y.Z."
33
+ end
34
+
35
+ major, minor, patch = GitMarkdown::VERSION.split(".").map(&:to_i)
36
+
37
+ case target
38
+ when "major"
39
+ "#{major + 1}.0.0"
40
+ when "minor"
41
+ "#{major}.#{minor + 1}.0"
42
+ when "patch"
43
+ "#{major}.#{minor}.#{patch + 1}"
44
+ end
45
+ end
46
+
47
+ def update_version_file(version)
48
+ File.write(
49
+ VERSION_PATH,
50
+ <<~RUBY
51
+ # frozen_string_literal: true
52
+
53
+ module GitMarkdown
54
+ VERSION = "#{version}"
55
+ end
56
+ RUBY
57
+ )
58
+ end
23
59
 
24
- unless valid_levels.include?(level)
25
- abort "Invalid level: #{level}. Use: #{valid_levels.join(", ")}"
26
- end
60
+ def update_changelog(version)
61
+ success = system("git-cliff", "-c", "cliff.toml", "--unreleased", "--tag", "v#{version}", "-o", "CHANGELOG.md")
62
+ raise "git-cliff failed. Install git-cliff and make sure cliff.toml is valid." unless success
63
+ raise "git-cliff did not update CHANGELOG.md. Ensure there are Conventional Commits since the last tag." if system("git", "diff", "--quiet", "--", "CHANGELOG.md")
64
+ end
65
+
66
+ if Rake::Task.task_defined?("release")
67
+ Rake::Task["release"].clear
68
+ end
27
69
 
28
- branch = `git rev-parse --abbrev-ref HEAD`.strip
29
- unless ["main", "master"].include?(branch)
30
- abort "Release must run on main or master. Current: #{branch}."
31
- end
70
+ desc "Publishing is handled by GitHub Actions. Use release:prepare[...] instead."
71
+ task :release do
72
+ abort "Use `bundle exec rake 'release:prepare[patch]'` (or minor/major/X.Y.Z). Publishing runs in GitHub Actions after the tag is pushed."
73
+ end
32
74
 
33
- unless system("git diff --quiet") && system("git diff --cached --quiet")
34
- abort "Release requires a clean working tree."
35
- end
75
+ namespace :release do
76
+ desc "Prepare a release: update CHANGELOG/version, commit, tag, and push. Accepts patch, minor, major, or X.Y.Z."
77
+ task :prepare, [:target] do |_task, args|
78
+ branch = current_branch
79
+ abort "Release must run on main or master. Current branch: #{branch.inspect}." unless %w[main master].include?(branch)
80
+ abort "Release requires a clean working tree." unless clean_worktree?
36
81
 
82
+ version = release_version(args[:target])
37
83
  current = GitMarkdown::VERSION
38
- parts = current.split(".").map(&:to_i)
39
-
40
- next_version = case level
41
- when "major"
42
- "#{parts[0] + 1}.0.0"
43
- when "minor"
44
- "#{parts[0]}.#{parts[1] + 1}.0"
45
- when "patch"
46
- "#{parts[0]}.#{parts[1]}.#{parts[2] + 1}"
47
- when "pre"
48
- "#{parts[0]}.#{parts[1]}.#{parts[2]}.pre.1"
49
- end
50
-
51
- puts "=== Step 1: Updating CHANGELOG.md for v#{next_version} ==="
52
- sh "git cliff -c cliff.toml --unreleased --tag v#{next_version} -o CHANGELOG.md"
53
-
54
- if system("git diff --quiet -- CHANGELOG.md")
55
- puts "Warning: No changelog changes detected"
56
- else
57
- puts "āœ“ Changelog updated"
58
- end
59
-
60
- puts "\n=== Step 2: Bumping version to #{next_version} ==="
61
-
62
- File.write(
63
- "lib/git/markdown/version.rb",
64
- <<~RUBY
65
- # frozen_string_literal: true
66
-
67
- module GitMarkdown
68
- VERSION = "#{next_version}"
69
- end
70
- RUBY
71
- )
72
-
73
- puts "āœ“ Version updated in lib/git/markdown/version.rb"
74
-
75
- puts "\n=== Step 3: Committing changes ==="
76
- sh "git add CHANGELOG.md lib/git/markdown/version.rb"
77
- sh "git commit -m \"chore(release): bump version to #{next_version}\""
78
- puts "āœ“ Changes committed"
84
+ abort "Release version #{version} is older than current version #{current}." if Gem::Version.new(version) < Gem::Version.new(current)
79
85
 
80
- puts "\n=== Step 4: Creating and pushing tag ==="
81
- sh "git tag -a v#{next_version} -m \"Release v#{next_version}\""
82
- sh "git push origin master"
83
- sh "git push origin v#{next_version}"
84
- puts "āœ“ Tag v#{next_version} created and pushed"
86
+ update_changelog(version)
87
+ update_version_file(version)
85
88
 
86
- puts "\nāœ… Release v#{next_version} prepared successfully!"
87
- puts "GitHub Actions will now build and publish the release."
89
+ sh "git add CHANGELOG.md lib/git/markdown/version.rb"
90
+ sh %(git commit -m "chore(release): prepare v#{version}")
91
+ sh %(git tag -a v#{version} -m "Release v#{version}")
92
+ sh "git push origin #{branch}"
93
+ sh "git push origin v#{version}"
94
+ rescue ArgumentError, RuntimeError => e
95
+ abort e.message
88
96
  end
89
97
  end
98
+
99
+ task default: %i[test standard]
data/git-markdown.gemspec CHANGED
@@ -6,6 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "git-markdown"
7
7
  spec.version = GitMarkdown::VERSION
8
8
  spec.authors = ["Paulo Fidalgo", "Ethos Link"]
9
+ spec.email = ["devel@ethos-link.com"]
9
10
 
10
11
  spec.summary = "Convert GitHub PRs to Markdown for local AI code review"
11
12
  spec.description = "A CLI tool that fetches GitHub pull requests and converts them to Markdown format, perfect for local AI assistants like opencode and codex."
@@ -23,6 +24,8 @@ Gem::Specification.new do |spec|
23
24
  "changelog_uri" => "#{repo}/blob/#{branch}/CHANGELOG.md",
24
25
  "documentation_uri" => "#{repo}/blob/#{branch}/README.md",
25
26
  "funding_uri" => "https://www.reviato.com/",
27
+ "github_repo" => "ssh://github.com/ethos-link/git-markdown",
28
+ "allowed_push_host" => "https://rubygems.org",
26
29
  "rubygems_mfa_required" => "true"
27
30
  }
28
31
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitMarkdown
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Fidalgo
@@ -96,11 +96,14 @@ dependencies:
96
96
  version: '3.0'
97
97
  description: A CLI tool that fetches GitHub pull requests and converts them to Markdown
98
98
  format, perfect for local AI assistants like opencode and codex.
99
+ email:
100
+ - devel@ethos-link.com
99
101
  executables:
100
102
  - git-markdown
101
103
  extensions: []
102
104
  extra_rdoc_files: []
103
105
  files:
106
+ - AGENT.md
104
107
  - AGENTS.md
105
108
  - CHANGELOG.md
106
109
  - Gemfile
@@ -137,6 +140,8 @@ metadata:
137
140
  changelog_uri: https://github.com/ethos-link/git-markdown/blob/master/CHANGELOG.md
138
141
  documentation_uri: https://github.com/ethos-link/git-markdown/blob/master/README.md
139
142
  funding_uri: https://www.reviato.com/
143
+ github_repo: ssh://github.com/ethos-link/git-markdown
144
+ allowed_push_host: https://rubygems.org
140
145
  rubygems_mfa_required: 'true'
141
146
  rdoc_options: []
142
147
  require_paths: