glyptodont 1.0.0 → 1.1.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: b0bdb41b7c944725ff0cc501c8ee3b64d77fd8aa5cee211d1697ce43fe8547d1
4
- data.tar.gz: 5d1a40a6f07b45b89487775ffad5d92ce3a84982ee19db732d13b8066e56ca68
3
+ metadata.gz: 7e18bcfa3a3f046b7b675c1612f35086438674024367463433cb60066cb008eb
4
+ data.tar.gz: 9cd7f2d0fe5ba7a0b947461164a48cd5875a4de539cd86cb26a1c7c2e5121898
5
5
  SHA512:
6
- metadata.gz: efdfeb5ca64d4c3f41b6320b7d7de4df52d02cc5dd68bf223c036c769c8b8477240e2b57336de69cbdbe8878cda22d7b3dfe56b6fe826d143f2342d11a9deb38
7
- data.tar.gz: 3672461a3f02c7572bae1289e4db373efde349a1d00ff34ee94cd142efbd1c8accdf3df4622e324395d70af9ee9b5136aba2d31e613f772664f7ca8b8f7812a9
6
+ metadata.gz: 6ebbbc04a10fc604c99bb9e6cee6757e5cfe21ed615f82177e1bf35e76ffaef4c201345c40f643d9fe81489d17457a06c85e0fdec389f572b16a0930580efa4c
7
+ data.tar.gz: b169d17d00ee585261e7d8dac21b5bb356365fc72de151593f1f77d9acda3ddce32d7e1f53d0f58743aa9d54f4928086ef433c8c0f80bcbf6b03f6beb1f95447
@@ -5,9 +5,9 @@
5
5
  name: Publish gem
6
6
 
7
7
  on:
8
- push:
9
- tags:
10
- - "v*"
8
+ release:
9
+ types:
10
+ - published
11
11
 
12
12
  env:
13
13
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
data/.glyptodont.yaml CHANGED
@@ -1,14 +1,21 @@
1
1
  ---
2
2
  threshold: 1
3
3
  max_age_in_days: 1
4
+ documentation_files:
5
+ - README.md
6
+ - CHANGELOG.md
7
+ - docs/index.html
4
8
  ignore:
5
- - README.md:11
6
- - README.md:16
9
+ - lib/glyptodont/checker.rb:18
10
+ - lib/glyptodont/checker.rb:19
11
+ - lib/glyptodont/checker.rb:20
12
+ - lib/glyptodont/checker.rb:21
7
13
  - lib/glyptodont/checkers/counter.rb:30
8
14
  - lib/glyptodont/checkers/counter.rb:32
9
- - lib/glyptodont/todo_researcher.rb:33
10
- - lib/glyptodont/todo_researcher.rb:34
11
- - lib/glyptodont/todo_researcher.rb:35
12
- - lib/glyptodont/todo_researcher.rb:36
13
- - spec/checkers/counter_spec.rb:20
14
- - spec/checkers/counter_spec.rb:28
15
+ - lib/glyptodont/options.rb:52
16
+ - lib/glyptodont/options.rb:54
17
+ - spec/glyptodont/checkers/counter_spec.rb:20
18
+ - spec/glyptodont/checkers/counter_spec.rb:28
19
+ - spec/glyptodont/todo_researcher_spec.rb:10
20
+ - spec/glyptodont/todo_researcher_spec.rb:33
21
+ - spec/glyptodont/todo_researcher_spec.rb:34
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.0.0"
2
+ ".": "1.1.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ 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
+ ## [1.1.0](https://github.com/johnsyweb/glyptodont/compare/v1.0.0...v1.1.0) (2026-03-11)
9
+
10
+
11
+ ### Features
12
+
13
+ * support documentation_files in configuration ([b6d2745](https://github.com/johnsyweb/glyptodont/commit/b6d27453f9ccb8198a20d45043335511f0d9e49a))
14
+
8
15
  ## [1.0.0](https://github.com/johnsyweb/glyptodont/compare/v0.3.0...v1.0.0) (2026-03-11)
9
16
 
10
17
 
data/README.md CHANGED
@@ -72,6 +72,11 @@ gem install glyptodont
72
72
  For usage, command-line options, configuration (`.glyptodont.yaml`), and CI
73
73
  examples (GitHub Actions, Buildkite, Docker), see the [documentation](https://www.johnsy.com/glyptodont/).
74
74
 
75
+ To avoid TODO-style comments in documentation and changelogs causing noise, you
76
+ can list whole documentation files in the `documentation_files` key in
77
+ `.glyptodont.yaml` (e.g. `CHANGELOG.md`, `docs/index.html`). Those files will
78
+ be skipped entirely, while source files continue to be checked.
79
+
75
80
  ## Requirements
76
81
 
77
82
  - [Mise](https://mise.jdx.dev/) — install once; `script/setup` uses it to install
data/docs/index.html CHANGED
@@ -172,6 +172,7 @@
172
172
  <li><strong>max_age_in_days</strong> — Maximum number of days to allow TODOs to stay. Overridable by <code>--max-age</code>.</li>
173
173
  <li><strong>ignore</strong> — List of <code>file_name:line_number</code> pairs to ignore (e.g. Spanish text or frequent mentions of TODOs).</li>
174
174
  <li><strong>keywords</strong> — List of synonyms for TODO in your project.</li>
175
+ <li><strong>documentation_files</strong> — List of documentation files to skip entirely when scanning for TODOs (e.g. <code>CHANGELOG.md</code>, <code>docs/index.html</code>).</li>
175
176
  </ul>
176
177
  <p>Example:</p>
177
178
  <pre><code>---
@@ -181,7 +182,10 @@ ignore:
181
182
  - README.md:11
182
183
  - lib/glyptodont/checkers/counter.rb:30
183
184
  - lib/glyptodont/todo_researcher.rb:33
184
- - spec/checkers/counter_spec.rb:20</code></pre>
185
+ - spec/checkers/counter_spec.rb:20
186
+ documentation_files:
187
+ - CHANGELOG.md
188
+ - docs/index.html</code></pre>
185
189
 
186
190
  <h3 id="command-line-options">Command-line options</h3>
187
191
  <pre><code>Usage: glyptodont [options]
@@ -27,7 +27,7 @@ module Glyptodont
27
27
  end
28
28
 
29
29
  def check?
30
- todos = TodoResearcher.new(directory, ignore, keywords).research
30
+ todos = TodoResearcher.new(directory, ignore, keywords, documentation_files).research
31
31
 
32
32
  checks = [
33
33
  Checkers::Counter.new(todos: todos, threshold: threshold),
@@ -44,6 +44,7 @@ module Glyptodont
44
44
  extend Forwardable
45
45
 
46
46
  def_delegator :@configuration, :ignore
47
+ def_delegator :@configuration, :documentation_files
47
48
  def_delegators :@options, :directory
48
49
 
49
50
  def threshold
@@ -27,6 +27,10 @@ module Glyptodont
27
27
  @keywords ||= config.fetch("keywords", nil)
28
28
  end
29
29
 
30
+ def documentation_files
31
+ @documentation_files ||= Array(config.fetch("documentation_files", []))
32
+ end
33
+
30
34
  private
31
35
 
32
36
  attr_reader :config_filename
@@ -6,20 +6,24 @@ require "rugged"
6
6
  module Glyptodont
7
7
  # Finds all the TODOs in a directory managed by Git, who last touched them and when.
8
8
  class TodoResearcher
9
- def initialize(directory, ignore, keywords)
9
+ def initialize(directory, ignore, keywords, documentation_files = [])
10
10
  @directory = directory
11
11
  @ignore = ignore
12
12
  @keywords = Array(keywords)
13
+ @documentation_files = Array(documentation_files)
13
14
  @annotator = {}
14
15
  end
15
16
 
16
17
  def research
17
- annotate(exclude_ignored(extract_details(git.grep(keyword_rexexp))))
18
+ todos = extract_details(git.grep(keyword_rexexp))
19
+ todos = exclude_documentation_files(todos)
20
+ todos = exclude_ignored(todos)
21
+ annotate(todos)
18
22
  end
19
23
 
20
24
  private
21
25
 
22
- attr_reader :directory, :ignore, :keywords
26
+ attr_reader :directory, :ignore, :keywords, :documentation_files
23
27
 
24
28
  def git
25
29
  Git.open(directory)
@@ -42,6 +46,12 @@ module Glyptodont
42
46
  end
43
47
  end
44
48
 
49
+ def exclude_documentation_files(todos)
50
+ return todos if documentation_files.empty?
51
+
52
+ todos.reject { |todo| documentation_files.include?(todo[:file]) }
53
+ end
54
+
45
55
  def exclude_ignored(todos)
46
56
  todos.reject { |todo| ignore.include?(todo.slice(:file, :line)) }
47
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Glyptodont
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glyptodont
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Johns