dead_end 2.0.1 → 2.0.2
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 +4 -4
- data/.github/workflows/check_changelog.yml +14 -7
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/exe/dead_end +5 -2
- data/lib/dead_end/display_invalid_blocks.rb +3 -2
- data/lib/dead_end/internals.rb +6 -3
- data/lib/dead_end/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec9e05716b47eb5d96ac063126a59977d98b8cf3e6f09ba0a0065d425a3c15e5
|
4
|
+
data.tar.gz: c78047c6dd36c1c716e1970e9bec5887bbcaf1fcc0341cbb5c11405043a07105
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eca38b35ef1371cae5fd104fa88dad33d44b17cb6bf29b01b5dea0c650d3d21c0dfbf2b1ac96f0a6f307e7d541cf2a2f7be062d59f1626b16c82f1a2f7d3a3e
|
7
|
+
data.tar.gz: 1a09171cb208465cf48ff5ac0346240d5bf155aebb886c27b6259742f325bc58a0b73ec9998fcbb1544440e6df7363fa7ab57a04dba9e7887207f30916e8c3a9
|
@@ -1,13 +1,20 @@
|
|
1
1
|
name: Check Changelog
|
2
2
|
|
3
3
|
on:
|
4
|
-
|
5
|
-
|
4
|
+
pull_request:
|
5
|
+
types: [opened, reopened, edited, labeled, unlabeled, synchronize]
|
6
|
+
|
6
7
|
jobs:
|
7
|
-
|
8
|
+
check-changelog:
|
8
9
|
runs-on: ubuntu-latest
|
10
|
+
if: |
|
11
|
+
!contains(github.event.pull_request.body, '[skip changelog]') &&
|
12
|
+
!contains(github.event.pull_request.body, '[changelog skip]') &&
|
13
|
+
!contains(github.event.pull_request.body, '[skip ci]') &&
|
14
|
+
!contains(github.event.pull_request.labels.*.name, 'skip changelog')
|
9
15
|
steps:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
16
|
+
- uses: actions/checkout@v2.3.5
|
17
|
+
- name: Check that CHANGELOG is touched
|
18
|
+
run: |
|
19
|
+
git fetch origin ${{ github.base_ref }} --depth 1 && \
|
20
|
+
git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/exe/dead_end
CHANGED
@@ -5,7 +5,6 @@ require "optparse"
|
|
5
5
|
require_relative "../lib/dead_end"
|
6
6
|
|
7
7
|
options = {}
|
8
|
-
options[:terminal] = true
|
9
8
|
options[:record_dir] = ENV["DEAD_END_RECORD_DIR"]
|
10
9
|
|
11
10
|
parser = OptionParser.new do |opts|
|
@@ -46,6 +45,10 @@ parser = OptionParser.new do |opts|
|
|
46
45
|
options[:record_dir] = v
|
47
46
|
end
|
48
47
|
|
48
|
+
opts.on("--terminal", "Enable terminal highlighting") do |v|
|
49
|
+
options[:terminal] = true
|
50
|
+
end
|
51
|
+
|
49
52
|
opts.on("--no-terminal", "Disable terminal highlighting") do |v|
|
50
53
|
options[:terminal] = false
|
51
54
|
end
|
@@ -67,7 +70,7 @@ warn "Record dir: #{options[:record_dir]}" if options[:record_dir]
|
|
67
70
|
display = DeadEnd.call(
|
68
71
|
source: file.read,
|
69
72
|
filename: file.expand_path,
|
70
|
-
terminal: options
|
73
|
+
terminal: options.fetch(:terminal, DeadEnd::DEFAULT_VALUE),
|
71
74
|
record_dir: options[:record_dir]
|
72
75
|
)
|
73
76
|
|
@@ -9,8 +9,9 @@ module DeadEnd
|
|
9
9
|
class DisplayInvalidBlocks
|
10
10
|
attr_reader :filename
|
11
11
|
|
12
|
-
def initialize(code_lines:, blocks:, io: $stderr, filename: nil, terminal:
|
13
|
-
@terminal = terminal
|
12
|
+
def initialize(code_lines:, blocks:, io: $stderr, filename: nil, terminal: DEFAULT_VALUE, invalid_obj: WhoDisSyntaxError::Null.new)
|
13
|
+
@terminal = terminal == DEFAULT_VALUE ? io.isatty : terminal
|
14
|
+
|
14
15
|
@filename = filename
|
15
16
|
@io = io
|
16
17
|
|
data/lib/dead_end/internals.rb
CHANGED
@@ -12,6 +12,10 @@ require "ripper"
|
|
12
12
|
require "timeout"
|
13
13
|
|
14
14
|
module DeadEnd
|
15
|
+
# Used to indicate a default value that cannot
|
16
|
+
# be confused with another input
|
17
|
+
DEFAULT_VALUE = Object.new.freeze
|
18
|
+
|
15
19
|
class Error < StandardError; end
|
16
20
|
SEARCH_SOURCE_ON_ERROR_DEFAULT = true
|
17
21
|
TIMEOUT_DEFAULT = ENV.fetch("DEAD_END_TIMEOUT", 1).to_i
|
@@ -27,15 +31,14 @@ module DeadEnd
|
|
27
31
|
if search_source_on_error
|
28
32
|
call(
|
29
33
|
source: Pathname(filename).read,
|
30
|
-
filename: filename
|
31
|
-
terminal: true
|
34
|
+
filename: filename
|
32
35
|
)
|
33
36
|
end
|
34
37
|
|
35
38
|
raise e
|
36
39
|
end
|
37
40
|
|
38
|
-
def self.call(source:, filename:, terminal:
|
41
|
+
def self.call(source:, filename:, terminal: DEFAULT_VALUE, record_dir: nil, timeout: TIMEOUT_DEFAULT, io: $stderr)
|
39
42
|
search = nil
|
40
43
|
Timeout.timeout(timeout) do
|
41
44
|
record_dir ||= ENV["DEBUG"] ? "tmp" : nil
|
data/lib/dead_end/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dead_end
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schneems
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: When you get an "unexpected end" in your syntax this gem helps you find
|
14
14
|
it
|