Skip to content

Commit

Permalink
Merge pull request #61 from DFE-Digital/upgrading-rubocop
Browse files Browse the repository at this point in the history
Upgrading rubocop to version 4

Fixes #58
  • Loading branch information
peteryates authored Nov 7, 2019
2 parents ed1d5a8 + 9d3f151 commit 3a99dea
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 23 deletions.
11 changes: 11 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
AllCops:
Exclude:
- govuk_design_system_formbuilder.gemspec
Rails/Date:
Enabled: false
Style/StringLiterals:
Enabled: false
Style/TrailingCommaInArguments:
Enabled: false
Style/TrailingCommaInHashLiteral:
Enabled: false
Style/TrailingCommaInArrayLiteral:
Enabled: false
27 changes: 14 additions & 13 deletions govuk_design_system_formbuilder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ $:.push File.expand_path('lib', __dir__)
require "govuk_design_system_formbuilder/version"
require_relative "util/version_formatter"

METADATA = {
"bug_tracker_uri" => "https://github.com/DFE-Digital/govuk_design_system_formbuilder/issues",
"changelog_uri" => "https://github.com/DFE-Digital/govuk_design_system_formbuilder/releases",
"documentation_uri" => "https://www.rubydoc.info/gems/govuk_design_system_formbuilder/GOVUKDesignSystemFormBuilder/Builder",
"homepage_uri" => "https://govuk-form-builder.netlify.com",
"source_code_uri" => "https://github.com/DFE-Digital/govuk_design_system_formbuilder"
}.freeze

Gem::Specification.new do |s|
s.name = "govuk_design_system_formbuilder"
s.version = GOVUKDesignSystemFormBuilder::VERSION
Expand All @@ -12,14 +20,7 @@ Gem::Specification.new do |s|
s.summary = "GOV.UK-compliant Rails form builder"
s.description = "A Rails form builder that generates form inputs adhering to the GOV.UK Design System"
s.license = "MIT"
s.metadata = {
"bug_tracker_uri" => "https://github.com/DFE-Digital/govuk_design_system_formbuilder/issues",
"changelog_uri" => "https://github.com/DFE-Digital/govuk_design_system_formbuilder/releases",
"documentation_uri" => "https://www.rubydoc.info/gems/govuk_design_system_formbuilder/GOVUKDesignSystemFormBuilder/Builder",
"homepage_uri" => "https://govuk-form-builder.netlify.com",
"source_code_uri" => "https://github.com/DFE-Digital/govuk_design_system_formbuilder"
}

s.metadata = METADATA
s.files = Dir["{app,lib}/**/*", "MIT-LICENSE", "README.md"]

exact_rails_version = ENV.has_key?("RAILS_VERSION")
Expand All @@ -29,19 +30,19 @@ Gem::Specification.new do |s|
s.add_dependency(*VersionFormatter.new(lib, rails_version, exact_rails_version).to_a)
end

s.add_development_dependency("govuk-lint", "~> 0")
s.add_development_dependency("govuk-lint", "~> 4")
s.add_development_dependency("pry", "~> 0.12.2")
s.add_development_dependency("pry-byebug", "~> 3.7", ">= 3.7.0")
s.add_development_dependency("rspec-html-matchers", "~> 0")
s.add_development_dependency("rspec-rails", "~> 3.8")
s.add_development_dependency("simplecov", "~> 0")

# Required for the guide
s.add_development_dependency("nanoc", "~> 4.11")
s.add_development_dependency("slim", "~> 4.0.1")
s.add_development_dependency("adsf", "~> 1.4.2")
s.add_development_dependency("adsf-live", "~> 1.4.2")
s.add_development_dependency("rouge", "~> 3.8.0")
s.add_development_dependency("htmlbeautifier", "~> 1.3.1")
s.add_development_dependency("sassc", "~> 2.2.1")
s.add_development_dependency("nanoc", "~> 4.11")
s.add_development_dependency("rouge", "~> 3.8.0")
s.add_development_dependency("sassc", "~> 2.1.0")
s.add_development_dependency("slim", "~> 4.0.1")
end
2 changes: 0 additions & 2 deletions guide/Rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env ruby

compile '/index.slim' do
filter :slim
layout '/splash.*'
Expand Down
1 change: 0 additions & 1 deletion guide/lib/helpers/link_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def rubygems_link
'https://rubygems.org/gems/govuk_design_system_formbuilder'
end


def prevent_double_click_link
'https://design-system.service.gov.uk/components/button/#stop-users-from-accidentally-sending-information-more-than-once'
end
Expand Down
8 changes: 5 additions & 3 deletions guide/lib/helpers/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ class Person
:first_name,
:last_name,
:job_title,
:postcode,
:postcode
)

# width examples
attr_accessor(
:twenty,
:ten,
:five,
Expand Down Expand Up @@ -81,8 +84,7 @@ class Person
attr_accessor(
:address_one,
:address_two,
:address_three,
:postcode
:address_three
)

# file fields
Expand Down
2 changes: 1 addition & 1 deletion guide/lib/helpers/related_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def text_field_info
'Form builder documentation for email fields' => 'https://www.rubydoc.info/gems/govuk_design_system_formbuilder/GOVUKDesignSystemFormBuilder/Builder#govuk_email_field-instance_method',
'Form builder documentation for URL fields' => 'https://www.rubydoc.info/gems/govuk_design_system_formbuilder/GOVUKDesignSystemFormBuilder/Builder#govuk_url_field-instance_method',

'GOV.UK design system text input' => 'https://design-system.service.gov.uk/components/text-input/',
'GOV.UK design system text input' => 'https://design-system.service.gov.uk/components/text-input/',
'MDN input mode documentation' => 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode',
'WhatWG documentation on input the type attribute' => 'https://html.spec.whatwg.org/multipage/input.html#states-of-the-type-attribute'
}
Expand Down
4 changes: 2 additions & 2 deletions guide/lib/setup/example_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def primary_colours_raw
# well as run it, it's kind of necessary. Not considering this a security
# threat as it's only used in the guide 👮

# rubocop:disable Lint/Eval
# rubocop:disable Security/Eval
def departments
eval(departments_data_raw)
end
Expand All @@ -65,7 +65,7 @@ def lunch_options
def primary_colours
eval(primary_colours_raw)
end
# rubocop:enable Lint/Eval
# rubocop:enable Security/Eval

def form_data
{ departments: departments, lunch_options: lunch_options, primary_colours: primary_colours }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def input_classes
end

def error_classes
('govuk-input--error') if has_errors?
'govuk-input--error' if has_errors?
end

def width_classes
Expand Down

0 comments on commit 3a99dea

Please sign in to comment.