Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not force verbose in danger local and danger pr #1424

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

## master

* **Breaking** - Prevent danger pr and danger local from enforcing verbose flags - [@manicmaniac](https://github.com/manicmaniac) [#1424](https://github.com/danger/danger/pull/1424)
* Make specs independent from default branch setting in git config - [@manicmaniac](https://github.com/manicmaniac) [#1420](https://github.com/danger/danger/pull/1420)
* Add missing error types to raise_error matcher - [@manicmaniac](https://github.com/manicmaniac) [#1421](https://github.com/danger/danger/pull/1421)
* Cannot specify danger_id testing locally - [@manicmaniac](https://github.com/manicmaniac) [#1362](https://github.com/danger/danger/issues/1362)
Expand Down
5 changes: 1 addition & 4 deletions lib/danger/commands/local_helpers/local_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ def setup(verbose: false)
cork.puts "Running your Dangerfile against this PR - https://#{gh.host}/#{source.repo_slug}/pull/#{source.pull_request_id}"
end

unless verbose
cork.puts "Turning on --verbose"
dm.verbose = true
end
dm.verbose = verbose

cork.puts

Expand Down
15 changes: 13 additions & 2 deletions spec/lib/danger/commands/local_helpers/local_setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,26 @@
expect(ui.string).not_to include("evaluated")
end

it "turns on verbose if arguments wasn't passed" do
it "turns on verbose if arguments was passed" do
github = double(:host => "", :support_tokenless_auth= => nil, :fetch_details => nil)
env = FakeEnv.new(ci_source, github)
dangerfile = FakeDangerfile.new(env, false)
ui = testing_ui
subject = described_class.new(dangerfile, ui)

subject.setup(verbose: true) {}
expect(dangerfile.verbose).to be(true)
end

it "turns off verbose if arguments wasn't passed" do
github = double(:host => "", :support_tokenless_auth= => nil, :fetch_details => nil)
env = FakeEnv.new(ci_source, github)
dangerfile = FakeDangerfile.new(env, false)
ui = testing_ui
subject = described_class.new(dangerfile, ui)

subject.setup(verbose: false) {}
expect(ui.string).to include("Turning on --verbose")
expect(dangerfile.verbose).to be(false)
end

it "does not evaluate Dangerfile if local repo wasn't found on github" do
Expand Down