Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
893f7caa
Unverified
Commit
893f7caa
authored
2 years ago
by
Kamil Kowalski
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(manager/mix): comment handling in dependency extraction (#19142)
parent
7c04604b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/manager/mix/__fixtures__/mix.exs
+1
-2
1 addition, 2 deletions
lib/modules/manager/mix/__fixtures__/mix.exs
lib/modules/manager/mix/extract.ts
+2
-2
2 additions, 2 deletions
lib/modules/manager/mix/extract.ts
with
3 additions
and
4 deletions
lib/modules/manager/mix/__fixtures__/mix.exs
+
1
−
2
View file @
893f7caa
...
...
@@ -15,8 +15,7 @@ defmodule MyProject.MixProject do
end
defp
deps
()
do
[
#{:broadway_dashboard, "~> 0.2.2"},
[
#{:broadway_dashboard, "~> 0.2.2"},
#{:broadway_dashboard, "~> 0.2.2"},
# {:broadway_dashboard, "~> 0.2.2"},
# {:broadway_dashboard, "~> 0.2.2"},
...
...
This diff is collapsed.
Click to expand it.
lib/modules/manager/mix/extract.ts
+
2
−
2
View file @
893f7caa
...
...
@@ -8,7 +8,7 @@ const depSectionRegExp = regEx(/defp\s+deps.*do/g);
const
depMatchRegExp
=
regEx
(
/{:
(?<
depName>
\w
+
)
,
\s
*
(?<
datasource>
[^
:"
]
+
)?
:
?\s
*"
(?<
currentValue>
[^
"
]
+
)
",
?\s
*
(?:
organization: "
(?<
organization>.*
)
"
)?
.*}/gm
);
const
commentMatchRegExp
=
regEx
(
/
^
\s
*#
/
);
const
commentMatchRegExp
=
regEx
(
/
#.*$
/
);
export
async
function
extractPackageFile
(
content
:
string
,
...
...
@@ -18,7 +18,7 @@ export async function extractPackageFile(
const
deps
:
PackageDependency
[]
=
[];
const
contentArr
=
content
.
split
(
newlineRegex
)
.
filter
((
line
)
=>
!
commentMatchRegExp
.
test
(
line
));
.
map
((
line
)
=>
line
.
replace
(
commentMatchRegExp
,
''
));
for
(
let
lineNumber
=
0
;
lineNumber
<
contentArr
.
length
;
lineNumber
+=
1
)
{
if
(
contentArr
[
lineNumber
].
match
(
depSectionRegExp
))
{
let
depBuffer
=
''
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment