Skip to content

Commit

Permalink
Elixir: Better file sanitization
Browse files Browse the repository at this point in the history
greysteil committed May 26, 2019
1 parent a9e94fc commit 81c8ec6
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hex/lib/dependabot/hex/file_updater/mixfile_sanitizer.rb
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ def sanitized_content
mixfile_content.
gsub(/File\.read!\(.*?\)/, '"0.0.1"').
gsub(/File\.read\(.*?\)/, '{:ok, "0.0.1"}').
gsub(/config_path:.*(?:,|$)/, "")
gsub(/^\s*config_path:.*(?:,|$)/, "")
end

private
5 changes: 5 additions & 0 deletions hex/spec/fixtures/mixfiles/minor_version
Original file line number Diff line number Diff line change
@@ -7,6 +7,11 @@ defmodule DependabotTest.Mixfile do
version: "0.1.0",
elixir: "~> 1.5",
config_path: "config/config.exs",
docs: [
main: "readme",
extras: ~w(README.md),
javascript_config_path: "../.doc-versions.js"
],
start_permanent: Mix.env == :prod,
deps: deps()
]

0 comments on commit 81c8ec6

Please sign in to comment.