kettle-dev 2.0.0 → 2.0.1

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.
data/certs/pboling.pem ADDED
@@ -0,0 +1,27 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
3
+ ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
4
+ A2NvbTAeFw0yNTA1MDQxNTMzMDlaFw00NTA0MjkxNTMzMDlaMEMxFTATBgNVBAMM
5
+ DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
6
+ LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAruUoo0WA
7
+ uoNuq6puKWYeRYiZekz/nsDeK5x/0IEirzcCEvaHr3Bmz7rjo1I6On3gGKmiZs61
8
+ LRmQ3oxy77ydmkGTXBjruJB+pQEn7UfLSgQ0xa1/X3kdBZt6RmabFlBxnHkoaGY5
9
+ mZuZ5+Z7walmv6sFD9ajhzj+oIgwWfnEHkXYTR8I6VLN7MRRKGMPoZ/yvOmxb2DN
10
+ coEEHWKO9CvgYpW7asIihl/9GMpKiRkcYPm9dGQzZc6uTwom1COfW0+ZOFrDVBuV
11
+ FMQRPswZcY4Wlq0uEBLPU7hxnCL9nKK6Y9IhdDcz1mY6HZ91WImNslOSI0S8hRpj
12
+ yGOWxQIhBT3fqCBlRIqFQBudrnD9jSNpSGsFvbEijd5ns7Z9ZMehXkXDycpGAUj1
13
+ to/5cuTWWw1JqUWrKJYoifnVhtE1o1DZ+LkPtWxHtz5kjDG/zR3MG0Ula0UOavlD
14
+ qbnbcXPBnwXtTFeZ3C+yrWpE4pGnl3yGkZj9SMTlo9qnTMiPmuWKQDatAgMBAAGj
15
+ fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQE8uWvNbPVNRXZ
16
+ HlgPbc2PCzC4bjAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
17
+ A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD
18
+ ggGBAJbnUwfJQFPkBgH9cL7hoBfRtmWiCvdqdjeTmi04u8zVNCUox0A4gT982DE9
19
+ wmuN12LpdajxZONqbXuzZvc+nb0StFwmFYZG6iDwaf4BPywm2e/Vmq0YG45vZXGR
20
+ L8yMDSK1cQXjmA+ZBKOHKWavxP6Vp7lWvjAhz8RFwqF9GuNIdhv9NpnCAWcMZtpm
21
+ GUPyIWw/Cw/2wZp74QzZj6Npx+LdXoLTF1HMSJXZ7/pkxLCsB8m4EFVdb/IrW/0k
22
+ kNSfjtAfBHO8nLGuqQZVH9IBD1i9K6aSs7pT6TW8itXUIlkIUI2tg5YzW6OFfPzq
23
+ QekSkX3lZfY+HTSp/o+YvKkqWLUV7PQ7xh1ZYDtocpaHwgxe/j3bBqHE+CUPH2vA
24
+ 0V/FwdTRWcwsjVoOJTrYcff8pBZ8r2MvtAc54xfnnhGFzeRHfcltobgFxkAXdE6p
25
+ DVjBtqT23eugOqQ73umLcYDZkc36vnqGxUBSsXrzY9pzV5gGr2I8YUxMqf6ATrZt
26
+ L9nRqA==
27
+ -----END CERTIFICATE-----
data/exe/kettle-changelog CHANGED
@@ -10,14 +10,14 @@
10
10
  # - TAG
11
11
  # - COVERAGE (line coverage)
12
12
  # - BRANCH COVERAGE (branch coverage)
13
- # - percent documented (parsed from `bin/yard` output)
13
+ # - percent documented (parsed from `bin/rake yard` output)
14
14
  # - Updates bottom link references to GitHub style, converts any existing
15
15
  # GitLab links to GitHub links, and appends the new [X.Y.Z] and [X.Y.Zt] links.
16
16
  #
17
17
  # Notes:
18
- # - Expects a JSON coverage report at coverage/coverage.json. If missing,
19
- # it will instruct you to run: K_SOUP_COV_FORMATTERS="json" bin/rspec
20
- # - Expects bin/yard to be available via Bundler.
18
+ # - Expects a JSON coverage report at coverage/coverage.json. In strict mode,
19
+ # it will generate one with bundle exec kettle-test.
20
+ # - Expects `bin/rake yard` to be available.
21
21
 
22
22
  $stdout.sync = true
23
23
 
@@ -50,27 +50,35 @@ end
50
50
  begin
51
51
  if ARGV.include?("-h") || ARGV.include?("--help")
52
52
  puts <<~USAGE
53
- Usage: kettle-changelog [--no-strict]
53
+ Usage: kettle-changelog [--update-prep] [--no-strict] [--no-coverage-threshold]
54
54
 
55
- Generates a new CHANGELOG.md entry for the current version detected from lib/**/version.rb.
56
- Moves entries from [Unreleased] into the new section, adds coverage and documentation stats,
57
- and updates bottom link references to GitHub style, adding new compare/tag links.
55
+ Detects the current version from lib/**/version.rb, the latest live release, and
56
+ the most recent CHANGELOG.md release section, then prompts to confirm the selected plan:
57
+ create a new release section, update the prepared release section in place, or reformat only.
58
+
59
+ Release plans add coverage and documentation stats, move entries from [Unreleased],
60
+ and update bottom link references to GitHub style.
58
61
 
59
62
  Options:
63
+ --update-prep Force updating the most recent prepared release section in place
60
64
  --no-strict Allow missing coverage and yard data (warnings only, no errors)
65
+ --no-coverage-threshold Generate coverage without hard-failing below configured thresholds
61
66
 
62
67
  Environment:
63
- K_CHANGELOG_STRICT=false Disable strict mode (equivalent to --no-strict flag)
68
+ K_CHANGELOG_STRICT=false Disable strict mode (equivalent to --no-strict flag)
69
+ K_CHANGELOG_COVERAGE_HARD=false Disable coverage threshold hard-failure
64
70
 
65
71
  Prerequisites:
66
- - coverage/coverage.json present (run: bin/rake coverage to generate)
67
- - yard installed and available via bin/yard
72
+ - coverage/coverage.json present (run: bundle exec kettle-test with K_SOUP_COV_FORMATTERS=json to generate)
73
+ - yard task available via bin/rake yard
68
74
 
69
75
  By default (strict mode), if coverage.json or yard stats are missing, the script will:
70
- 1. Attempt to generate them by running bin/rake coverage and bin/rake yard
76
+ 1. Attempt to generate them by running bundle exec kettle-test and bin/rake yard
71
77
  2. Fail with an error if generation fails or data is still unavailable
78
+ 3. Fail if coverage is below the configured project thresholds
72
79
 
73
80
  Use --no-strict or K_CHANGELOG_STRICT=false to allow missing data (backward compatible behavior).
81
+ Use --no-coverage-threshold or K_CHANGELOG_COVERAGE_HARD=false to bypass coverage threshold failures.
74
82
  USAGE
75
83
  exit(0)
76
84
  end
@@ -79,8 +87,11 @@ end
79
87
  begin
80
88
  # Determine if strict mode is enabled (default: true)
81
89
  strict_mode = !ARGV.include?("--no-strict") && ENV.fetch("K_CHANGELOG_STRICT", "true").downcase != "false"
90
+ update_prep = ARGV.include?("--update-prep")
91
+ coverage_threshold_disabled = ARGV.include?("--no-coverage-threshold") || ARGV.include?("--no-coverage-thresholds")
92
+ coverage_hard = !coverage_threshold_disabled && ENV.fetch("K_CHANGELOG_COVERAGE_HARD", "true").downcase != "false"
82
93
 
83
- Kettle::Dev::ChangelogCLI.new(strict: strict_mode).run
94
+ Kettle::Dev::ChangelogCLI.new(strict: strict_mode, enforce_coverage_thresholds: coverage_hard, update_prep: update_prep).run
84
95
  rescue LoadError => e
85
96
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
86
97
  warn(e.backtrace.join("\n")) if ENV["DEBUG"]
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ bin_dir = File.expand_path(__dir__)
5
+ bash_script = File.join(bin_dir, "kettle-check-eof.sh")
6
+
7
+ exec(bash_script, *ARGV)
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Finds files without exactly one trailing newline
4
+ # Pass "-f" to also fix those files
5
+ #
6
+ # Always have exactly one newline at the end of every file comprised of text.
7
+ # In a POSIX system a file missing a final newline is technically not a text file.
8
+ # Some tools will not parse them, or parse them in unexpected ways.
9
+ # NOTE: We'll forgive external files, in node_modules, and vendor.
10
+ # See:
11
+ # Official POSIX Standard: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
12
+ # Discussion of "why newline at EOF?": https://stackoverflow.com/q/729692/213191
13
+ # Theory behind `-not \( -path ... \)`: https://stackoverflow.com/a/69830768/213191
14
+ # Thanks: Gabriel Staples, https://stackoverflow.com/users/4561887/gabriel-staples
15
+ #
16
+ # Author: Peter H Boling
17
+ # Copyright (c) 2026 Peter H Boling. All rights reserved.
18
+ # License MIT (see LICENSE file in repository root for details)
19
+
20
+ set -euo pipefail
21
+
22
+ FIX_MODE=false
23
+ if [[ "${1:-}" == "-f" ]]; then
24
+ FIX_MODE=true
25
+ fi
26
+
27
+ # Function to check if file has exactly one trailing newline
28
+ check_eof() {
29
+ local file="$1"
30
+ # Empty files are OK (nothing to fix)
31
+ [[ ! -s "$file" ]] && return 0
32
+
33
+ # Check last two bytes to detect:
34
+ # - Missing newline (last byte != newline)
35
+ # - Multiple trailing newlines (last two bytes == newline newline)
36
+ local last_bytes
37
+ last_bytes=$(tail -c 2 "$file" | od -An -tx1 | tr -d ' \n')
38
+
39
+ # 0a = newline in hex
40
+ case "$last_bytes" in
41
+ *0a0a) return 1 ;; # Multiple trailing newlines
42
+ *0a) return 0 ;; # Exactly one trailing newline
43
+ *) return 1 ;; # Missing trailing newline
44
+ esac
45
+ }
46
+
47
+ # Function to fix file to have exactly one trailing newline
48
+ fix_eof() {
49
+ local file="$1"
50
+ # Remove all trailing newlines, then add exactly one
51
+ # Using perl for portability (sed -i behaves differently on macOS vs Linux)
52
+ perl -pi -e 'chomp if eof' "$file"
53
+ echo >> "$file"
54
+ }
55
+
56
+ # Find all text files, excluding specified patterns
57
+ invalid_files=()
58
+
59
+ while IFS= read -r -d '' file; do
60
+ # Skip if not a text file
61
+ if ! file -b "$file" | grep -q text; then
62
+ continue
63
+ fi
64
+
65
+ if ! check_eof "$file"; then
66
+ invalid_files+=("$file")
67
+ if $FIX_MODE; then
68
+ fix_eof "$file"
69
+ echo "Fixed: $file"
70
+ else
71
+ echo "$file"
72
+ fi
73
+ fi
74
+ done < <(find . \
75
+ -type f \
76
+ -not \( -name "*.csv" \) \
77
+ -not \( -name "*.dio" \) \
78
+ -not \( -name "*.gem" \) \
79
+ -not \( -name "*.json" \) \
80
+ -not \( -name "*.pem" \) \
81
+ -not \( -name "*.tpl" \) \
82
+ -not \( -name "VERSION*" \) \
83
+ -not \( -path "*/.bundle/*" -prune \) \
84
+ -not \( -path "*/.git/*" -prune \) \
85
+ -not \( -path "*/.idea/*" -prune \) \
86
+ -not \( -path "*/.vscode/*" -prune \) \
87
+ -not \( -path "*/.yardoc/*" -prune \) \
88
+ -not \( -path "*/angular/*" -prune \) \
89
+ -not \( -path "*/certs/*" -prune \) \
90
+ -not \( -path "*/checksums/*" -prune \) \
91
+ -not \( -path "*/coverage/*" -prune \) \
92
+ -not \( -path "*/doc/*" -prune \) \
93
+ -not \( -path "*/docs/*" -prune \) \
94
+ -not \( -path "*/log/*" -prune \) \
95
+ -not \( -path "*/node_modules/*" -prune \) \
96
+ -not \( -path "*/pkg/*" -prune \) \
97
+ -not \( -path "*/public/*" -prune \) \
98
+ -not \( -path "*/results/*" -prune \) \
99
+ -not \( -path "*/test-results/*" -prune \) \
100
+ -not \( -path "*/tmp/*" -prune \) \
101
+ -not \( -path "*/vendor/*" -prune \) \
102
+ -print0)
103
+
104
+ # Exit with appropriate status
105
+ if [[ ${#invalid_files[@]} -eq 0 ]]; then
106
+ exit 0
107
+ else
108
+ if $FIX_MODE; then
109
+ echo ""
110
+ echo "Fixed ${#invalid_files[@]} file(s)"
111
+ exit 0
112
+ else
113
+ echo ""
114
+ echo "Found ${#invalid_files[@]} file(s) with invalid EOF"
115
+ echo "Run with -f to fix"
116
+ exit 1
117
+ fi
118
+ fi