Skip to content

Commit

Permalink
Add govuk-lint
Browse files Browse the repository at this point in the history
And fix some minor issues. Will run on CI.
  • Loading branch information
tijmenb committed Mar 8, 2017
1 parent afbc4c3 commit ea73689
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,2 @@
Style/ClassVars:
Enabled: false
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -6,6 +6,7 @@ gem 'rake'
gem 'rspec', '~> 3.5'
gem 'webmock', '~> 2.1'
gem 'activesupport', '~> 5.0'
gem 'govuk-lint', '~> 2.0'

# Middleman Gems
gem 'middleman', '>= 4.0.0'
Expand Down
20 changes: 20 additions & 0 deletions Gemfile.lock
Expand Up @@ -15,6 +15,7 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.3.8)
ast (2.3.0)
autoprefixer-rails (6.5.4)
execjs
backports (3.6.8)
Expand Down Expand Up @@ -58,6 +59,9 @@ GEM
fastimage (2.0.1)
addressable (~> 2)
ffi (1.9.14)
govuk-lint (2.0.0)
rubocop (~> 0.43.0)
scss_lint
govuk_schemas (2.1.0)
json-schema (~> 2.5.0)
haml (4.0.7)
Expand Down Expand Up @@ -142,11 +146,15 @@ GEM
padrino-support (0.13.3.3)
activesupport (>= 3.1)
parallel (1.10.0)
parser (2.4.0.0)
ast (~> 2.2)
powerpack (0.1.1)
rack (2.0.1)
rack-contrib (1.2.0)
rack (>= 0.9.1)
rack-livereload (0.3.16)
rack
rainbow (2.2.1)
rake (11.1.2)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
Expand All @@ -166,11 +174,21 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubocop (0.43.0)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
safe_yaml (1.0.4)
sass (3.4.22)
sawyer (0.6.0)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
scss_lint (0.52.0)
rake (>= 0.9, < 13)
sass (~> 3.4.20)
servolux (0.12.0)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
Expand All @@ -182,6 +200,7 @@ GEM
thread_safe (~> 0.1)
uglifier (3.0.3)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.1.3)
webmock (2.1.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
Expand All @@ -194,6 +213,7 @@ DEPENDENCIES
activesupport (~> 5.0)
faraday-http-cache
faraday_middleware
govuk-lint (~> 2.0)
govuk_schemas (~> 2.1.0)
middleman (>= 4.0.0)
middleman-autoprefixer (~> 2.7.0)
Expand Down
1 change: 1 addition & 0 deletions circle.yml
Expand Up @@ -4,4 +4,5 @@ compile:

test:
override:
- bundle exec govuk-lint-ruby
- bundle exec rspec
4 changes: 2 additions & 2 deletions config.ru
Expand Up @@ -13,6 +13,6 @@ use Rack::TryStatic,
urls: %w[/],
try: ['.html', 'index.html', '/index.html']

run lambda { |env|
[ 404, { 'Content-Type' => 'text/html'}, [ "404 Not Found" ]]
run lambda { |_env|
[404, { 'Content-Type' => 'text/html' }, ["404 Not Found"]]
}
2 changes: 0 additions & 2 deletions lib/dashboard/dashboard.rb
Expand Up @@ -11,8 +11,6 @@ def chapters
end
end

private

class Thing
attr_reader :data

Expand Down
2 changes: 1 addition & 1 deletion lib/dashboard/github.rb
Expand Up @@ -7,7 +7,7 @@ class GitHub
# org. Because 99% of the repos will be from that org, we can download and
# cache all alphagov-repos and save on API calls.
def repo(app_name)
if app_name.match("/")
if app_name =~ "/"
# Not on alpghagov, make a separate call to the API. Cache it for
# development speed.
@@cache ||= {}
Expand Down
2 changes: 1 addition & 1 deletion lib/publishing_api_docs.rb
Expand Up @@ -7,7 +7,7 @@ class PublishingApiDocs
"pact_testing" => "Contract testing with Pact",
"publishing-application-examples" => "Examples",
"rabbitmq" => "Message queue",
}
}.freeze

def self.pages
PAGES.map { |k, v| Page.new(k, v) }
Expand Down
2 changes: 1 addition & 1 deletion lib/requires.rb
Expand Up @@ -2,4 +2,4 @@
require 'tilt'
require 'middleman-core'

Dir[File.dirname(__FILE__) + '/**/*.rb'].each {|file| require file }
Dir[File.dirname(__FILE__) + '/**/*.rb'].each { |file| require file }

0 comments on commit ea73689

Please sign in to comment.