Skip to content

Commit a33237f

Browse files
committed
Merge remote-tracking branch 'shopify/main' into denis/merge-shopify-main
2 parents 8cec23c + 00f663b commit a33237f

File tree

19 files changed

+701
-67
lines changed

19 files changed

+701
-67
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "bundler"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
labels:
8+
- "dependencies"
9+
groups:
10+
minor-and-patch:
11+
update-types:
12+
- "minor"
13+
- "patch"
14+
open-pull-requests-limit: 100
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
19+
labels:
20+
- "dependencies"

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
name: Ruby ${{ matrix.version }}
1313
strategy:
1414
matrix:
15-
version: [3.0, 3.1, 3.2]
15+
version: [3.0, 3.1, 3.2, 3.3]
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
- name: Set up Ruby ${{ matrix.version }}
2020
uses: ruby/setup-ruby@v1
2121
with:

.github/workflows/rubocop.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
11-
- name: Set up Ruby 3.0
10+
- uses: actions/checkout@v4
11+
- name: Set up Ruby
1212
uses: ruby/setup-ruby@v1
1313
with:
14-
ruby-version: 3.0
1514
bundler-cache: true
1615
- name: Install gems
1716
run: |

.rubocop.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ inherit_gem:
22
rubocop-shopify: rubocop.yml
33

44
AllCops:
5-
TargetRubyVersion: 3.0
65
NewCops: disable
76
SuggestExtensions: false
87
Exclude:

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.0

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
smart_todo (1.7.2)
4+
smart_todo (1.10.0)
55
prism (~> 1.0)
66

77
GEM

dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type:
44
- ruby
55

66
up:
7-
- ruby: 3.0.2
7+
- ruby
88
- bundler
99

1010
console:

lib/smart_todo/cli.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def define_options
6969
opts.on("--read-repository-config") do |_repository_config|
7070
@options[:repository_config] = GitConfigParser.new
7171
end
72+
opts.on("--repo [REPO]", "Repository name to include in notifications") do |repo|
73+
@options[:repo] = repo || File.basename(Dir.pwd)
74+
end
7275
end
7376
end
7477

lib/smart_todo/comment_parser.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
module SmartTodo
44
class CommentParser
5+
SUPPORTED_TAGS = ["TODO", "FIXME", "OPTIMIZE"].freeze
6+
TAG_PATTERN = /^#\s(#{SUPPORTED_TAGS.join("|")})\(/
7+
58
attr_reader :todos
69

710
def initialize
@@ -54,7 +57,7 @@ def parse_comments(comments, filepath)
5457

5558
source = comment.location.slice
5659

57-
if source.match?(/^#\sTODO\(/)
60+
if source.match?(TAG_PATTERN)
5861
todos << current_todo if current_todo
5962
current_todo = Todo.new(source, filepath)
6063
elsif current_todo && (indent = source[/^#(\s*)/, 1].length) && (indent - current_todo.indent == 2)

lib/smart_todo/dispatchers/base.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def slack_message(user, assignee)
6868
<<~EOM
6969
#{header}
7070
71-
You have an assigned TODO in the `#{filepath_or_url}` file.
71+
You have an assigned TODO in the `#{filepath_or_url}` file#{repo}.
7272
#{@event_message}
7373
7474
Here is the associated comment on your TODO:
@@ -99,6 +99,15 @@ def filepath_or_url
9999

100100
@file
101101
end
102+
103+
def repo
104+
repo = @options[:repo]
105+
return unless repo
106+
107+
unless repo.empty?
108+
" in repository `#{repo}`"
109+
end
110+
end
102111
end
103112
end
104113
end

0 commit comments

Comments
 (0)