Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d260daa8
Commit
d260daa8
authored
Feb 19, 2021
by
Alishan Ladhani
Committed by
Peter Leitzen
Feb 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scope regex to ruby files
Since we are looking for a ruby method here
parent
5267422c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
danger/product_intelligence/Dangerfile
danger/product_intelligence/Dangerfile
+16
-1
No files found.
danger/product_intelligence/Dangerfile
View file @
d260daa8
...
...
@@ -45,8 +45,23 @@ usage_data_changed_files = all_changed_files.grep(%r{(usage_data)})
metrics_changed_files
=
all_changed_files
.
grep
(
%r{((ee/)?config/metrics/.*
\.
yml)}
)
dictionary_changed_file
=
all_changed_files
.
grep
(
%r{(doc/development/usage_ping/dictionary.md)}
)
def
matching_files?
(
file
,
extension
:,
pattern
:)
return
unless
file
.
end_with?
(
extension
)
helper
.
changed_lines
(
file
).
grep
(
pattern
).
any?
end
js_patterns
=
Regexp
.
union
(
'Tracking.event'
,
/\btrack\(/
,
'data-track-event'
)
snowplow_changed_files
=
all_changed_files
.
select
do
|
file
|
helper
.
changed_lines
(
file
).
grep
(
%r{Gitlab::Tracking
\.
event}
).
any?
matching_files?
(
file
,
extension:
'.rb'
,
pattern:
%r{Gitlab::Tracking
\.
event}
)
||
matching_files?
(
file
,
extension:
'.js'
,
pattern:
js_patterns
)
||
matching_files?
(
file
,
extension:
'.vue'
,
pattern:
js_patterns
)
||
matching_files?
(
file
,
extension:
'.haml'
,
pattern:
%r{data:
\{
track}
)
end
matching_changed_files
=
usage_data_changed_files
+
tracking_changed_files
+
metrics_changed_files
+
dictionary_changed_file
+
snowplow_changed_files
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment