Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup CI to fail builds on lint failures (#34)
* Run phare as part of CI * Update rubocop styles to match Venuu style * Autofix rubocop autofixable lint warnings * Ignore vendor/bundle and tmp dirs from rubocop * Ignore Style/FileName lint warning for main import file * Fix lint warning for semicolon usage * Don't warn about line length in .gemspec file * Split long lines in AuthorizingProcessor * Split long lines in pundit stubs spec helpers * Exclude request specs for line length lint for now The authorization stubs and checks are quite long and we might want to think about creating a better way of writing them instead of trying to add unnecessary line length by splitting them on multiple lines. * Move LineLength disable from .gemspec file to rubocop conf * Move Style/FileName disable for main import to rubocop conf
- Loading branch information
Showing
12 changed files
with
100 additions
and
23 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
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,17 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'phare' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
load Gem.bin_path("phare", "phare") |
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,17 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'rubocop' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
load Gem.bin_path("rubocop", "rubocop") |
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
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
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
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
module PunditStubs | ||
def allow_action(action, record) | ||
policy = ::Pundit::PolicyFinder.new(record).policy | ||
allow(policy).to receive(:new).with(any_args, record) { instance_double(policy, action => true) } | ||
allow(policy).to( | ||
receive(:new).with(any_args, record) { instance_double(policy, action => true) } | ||
) | ||
end | ||
|
||
def disallow_action(action, record) | ||
policy = ::Pundit::PolicyFinder.new(record).policy | ||
allow(policy).to receive(:new).with(any_args, record) { instance_double(policy, action => false) } | ||
allow(policy).to( | ||
receive(:new).with(any_args, record) { instance_double(policy, action => false) } | ||
) | ||
end | ||
end |