-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Danger.system to review PRs (#81)
- Loading branch information
Showing
7 changed files
with
133 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ cabal.sandbox.config | |
.stack-work/ | ||
cabal.project.local | ||
codex.tags | ||
_Dangerfile.tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Sometimes it's a README fix, or something like that - which isn't relevant for | ||
# including in a project's CHANGELOG for example | ||
declared_trivial = github.pr_title.include? "#trivial" | ||
|
||
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet | ||
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]" | ||
|
||
# Warn when there is a big PR | ||
warn("Big PR") if git.lines_of_code > 500 | ||
|
||
|
||
affected_files = git.added_files + git.modified_files | ||
|
||
haskell_files = affected_files.select { |file| file.end_with?('.hs') } | ||
|
||
hlint.lint(haskell_files, true) | ||
|
||
# Don't let testing shortcuts get into master by accident | ||
fail("fdescribe left in tests") if `grep -r fdescribe specs/ `.length > 1 | ||
fail("fit left in tests") if `grep -r fit specs/ `.length > 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
source "https://rubygems.org" | ||
|
||
gem "danger" | ||
gem "danger-hlint" | ||
gem "pry" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
addressable (2.5.1) | ||
public_suffix (~> 2.0, >= 2.0.2) | ||
claide (1.0.2) | ||
claide-plugins (0.9.2) | ||
cork | ||
nap | ||
open4 (~> 1.3) | ||
coderay (1.1.1) | ||
colored2 (3.1.2) | ||
cork (0.3.0) | ||
colored2 (~> 3.1) | ||
danger (5.3.3) | ||
claide (~> 1.0) | ||
claide-plugins (>= 0.9.2) | ||
colored2 (~> 3.1) | ||
cork (~> 0.1) | ||
faraday (~> 0.9) | ||
faraday-http-cache (~> 1.0) | ||
git (~> 1) | ||
kramdown (~> 1.5) | ||
octokit (~> 4.7) | ||
terminal-table (~> 1) | ||
danger-hlint (0.0.2) | ||
danger-plugin-api (~> 1.0) | ||
danger-plugin-api (1.0.0) | ||
danger (> 2.0) | ||
faraday (0.12.1) | ||
multipart-post (>= 1.2, < 3) | ||
faraday-http-cache (1.3.1) | ||
faraday (~> 0.8) | ||
git (1.3.0) | ||
kramdown (1.14.0) | ||
method_source (0.8.2) | ||
multipart-post (2.0.0) | ||
nap (1.1.0) | ||
octokit (4.7.0) | ||
sawyer (~> 0.8.0, >= 0.5.3) | ||
open4 (1.3.4) | ||
pry (0.10.4) | ||
coderay (~> 1.1.0) | ||
method_source (~> 0.8.1) | ||
slop (~> 3.4) | ||
public_suffix (2.0.5) | ||
sawyer (0.8.1) | ||
addressable (>= 2.3.5, < 2.6) | ||
faraday (~> 0.8, < 1.0) | ||
slop (3.6.0) | ||
terminal-table (1.8.0) | ||
unicode-display_width (~> 1.1, >= 1.1.1) | ||
unicode-display_width (1.3.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
danger | ||
danger-hlint | ||
pry | ||
|
||
BUNDLED WITH | ||
1.14.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
namespace :hlint do | ||
|
||
desc "Download and install hlint" | ||
task :install do | ||
REPO = "https://github.com/ndmitchell/hlint" | ||
VERSION = "2.0.9"#DangerHlint::HLINT_VERSION | ||
ASSET = "hlint-#{VERSION}-x86_64-linux.tar.gz" | ||
URL = "#{REPO}/releases/download/v#{VERSION}/#{ASSET}" | ||
DESTINATION_BASE = File.expand_path(File.join(File.dirname(__FILE__), 'bin')) | ||
DESTINATION_TMP = File.join("#{DESTINATION_BASE}", 'tmp') | ||
|
||
puts "Downloading hlint@v#{VERSION}" | ||
sh [ | ||
"mkdir -p #{DESTINATION_TMP}", | ||
"curl -s -L #{URL} -o #{ASSET}", | ||
"tar -xf #{ASSET} -C #{DESTINATION_TMP}", | ||
"cp #{DESTINATION_TMP}/hlint-#{VERSION}/hlint #{File.expand_path("~/.local/bin")}", | ||
"cp -R #{DESTINATION_TMP}/hlint-#{VERSION}/data #{File.expand_path("~/.local/bin")}", | ||
"rm -r #{DESTINATION_BASE}/", | ||
"rm #{ASSET}" | ||
].join(" && ") | ||
end | ||
|
||
end | ||
|
||
task default: 'hlint:install' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters