Этот коммит содержится в:
Mattia Roccoberton
2021-05-23 14:23:56 +02:00
родитель 9b460d36e3
Коммит 0b44c683e6
9 изменённых файлов: 162 добавлений и 3 удалений

11
.github/workflows/specs.yml поставляемый
Просмотреть файл

@@ -17,10 +17,19 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Ruby - name: Set up Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: ${{ matrix.ruby }} ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically bundler-cache: true
- name: Run tests - name: Run tests
run: bundle exec rake run: bundle exec rake
- name: Archive screenshots for failed tests
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-failed-screenshots
path: spec/dummy/tmp/screenshots

11
.reek.yml Обычный файл
Просмотреть файл

@@ -0,0 +1,11 @@
---
exclude_paths:
- spec/dummy
- vendor
detectors:
IrresponsibleModule:
enabled: false
TooManyStatements:
# default 5
max_statements: 10

Просмотреть файл

@@ -1,6 +1,12 @@
inherit_from: inherit_from:
- https://relaxed.ruby.style/rubocop.yml - https://relaxed.ruby.style/rubocop.yml
require:
- rubocop-packaging
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops: AllCops:
Exclude: Exclude:
- bin/* - bin/*
@@ -17,6 +23,14 @@ Layout/LineLength:
Enabled: true Enabled: true
Max: 120 Max: 120
RSpec/ExampleLength:
# default 5
Max: 12
RSpec/MultipleExpectations:
# default 1
Max: 4
Style/HashEachMethods: Style/HashEachMethods:
Enabled: true Enabled: true

11
Gemfile
Просмотреть файл

@@ -4,13 +4,22 @@ source 'https://rubygems.org'
gemspec gemspec
# Linters
gem 'brakeman'
gem 'fasterer'
gem 'reek'
gem 'rubocop'
gem 'rubocop-packaging'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'rubocop-rspec'
group :development, :test do group :development, :test do
gem 'activestorage', '~> 6.0' gem 'activestorage', '~> 6.0'
gem 'capybara', '~> 3.33' gem 'capybara', '~> 3.33'
gem 'puma', '~> 4.3' gem 'puma', '~> 4.3'
gem 'rspec_junit_formatter', '~> 0.4' gem 'rspec_junit_formatter', '~> 0.4'
gem 'rspec-rails', '~> 4.0' gem 'rspec-rails', '~> 4.0'
gem 'rubocop', '~> 1.0'
gem 'selenium-webdriver', '~> 3.142' gem 'selenium-webdriver', '~> 3.142'
gem 'sprockets-rails', '~> 3.2' gem 'sprockets-rails', '~> 3.2'
gem 'sqlite3', '~> 1.4' gem 'sqlite3', '~> 1.4'

29
bin/brakeman Исполняемый файл
Просмотреть файл

@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'brakeman' 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)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("brakeman", "brakeman")

29
bin/code_climate_reek Исполняемый файл
Просмотреть файл

@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'code_climate_reek' 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)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("reek", "code_climate_reek")

29
bin/fasterer Исполняемый файл
Просмотреть файл

@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'fasterer' 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)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("fasterer", "fasterer")

29
bin/reek Исполняемый файл
Просмотреть файл

@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'reek' 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)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("reek", "reek")

Просмотреть файл

@@ -41,7 +41,7 @@ ActiveAdmin.register Post do
row :images do |resurce| row :images do |resurce|
resurce.images.each do |image| resurce.images.each do |image|
div do div do
link_to image.filename, image, target: '_blank' link_to image.filename, image, target: '_blank', rel: 'noopener'
end end
end end
nil nil