diff --git a/Gemfile b/Gemfile index 587ab06..c0db420 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# rubocop:disable Style/FrozenStringLiteralComment source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } @@ -43,9 +44,9 @@ group :development do gem 'listen', '~> 3.2' gem 'web-console', '>= 3.3.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'bullet' gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' - gem "bullet" end group :test do @@ -58,3 +59,5 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] + +# rubocop: enable Style/FrozenStringLiteralComment diff --git a/app/.rubocop.yml b/app/.rubocop.yml new file mode 100644 index 0000000..dc0b5a4 --- /dev/null +++ b/app/.rubocop.yml @@ -0,0 +1,63 @@ +AllCops: + Exclude: + - "db/**/*" + - "bin/*" + - "test/*" + - "config/**/*" + - "Guardfile" + - "Rakefile" + - "README.md" + - "node_modules/**/*" + + DisplayCopNames: true + +Layout/LineLength: + Max: 120 +Metrics/MethodLength: + Include: + - "app/controllers/*" + - "app/models/*" + Max: 20 +Metrics/AbcSize: + Include: + - "app/controllers/*" + - "app/models/*" + Max: 50 +Metrics/ClassLength: + Max: 150 +Metrics/BlockLength: + ExcludedMethods: ['describe'] + Max: 30 + +Style/Documentation: + Enabled: false +Style/ClassAndModuleChildren: + Enabled: false +Style/EachForSimpleLoop: + Enabled: false +Style/AndOr: + Enabled: false +Style/DefWithParentheses: + Enabled: false +Style/FrozenStringLiteralComment: + EnforcedStyle: never +Style/HashEachMethods: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false + + +Layout/HashAlignment: + EnforcedColonStyle: key +Layout/ExtraSpacing: + AllowForAlignment: false +Layout/MultilineMethodCallIndentation: + Enabled: true + EnforcedStyle: indented + +Lint/RaiseException: + Enabled: false +Lint/StructNewOverride: + Enabled: false \ No newline at end of file diff --git a/app/.stickler.yml b/app/.stickler.yml new file mode 100644 index 0000000..37e97a4 --- /dev/null +++ b/app/.stickler.yml @@ -0,0 +1,23 @@ +# add the linters you want stickler to use for this project +linters: + rubocop: + display_cop_names: true + # indicate where is the config file for stylelint + config: './rubocop.yml' + +# add the files here you want to be ignored by stylelint +files: + ignore: + - "bin/*" + - "test/*" + - "db/*" + - "config/*" + - "Guardfile" + - "Rakefile" + - "README.md" + - "node_modules/**/*" + +# PLEASE DO NOT enable auto fixing options +# if you need extra support from you linter - do it in your local env as described in README for this config + +# find full documentation here: https://stickler-ci.com/docs \ No newline at end of file diff --git a/app/views/groups/_form.html.erb b/app/views/groups/_form.html.erb index 8240a20..49f5f36 100644 --- a/app/views/groups/_form.html.erb +++ b/app/views/groups/_form.html.erb @@ -1,22 +1,18 @@ <%= form_for @group do |f| %> - - <% if @group.errors.any? %> -