Skip to content

Commit

Permalink
Add dependency for erb-lint and update ci file for the pipeline run
Browse files Browse the repository at this point in the history
  • Loading branch information
ellohez authored and syed-ali-tw committed Aug 14, 2024
1 parent 888b3c9 commit 5c3347a
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
EnableDefaultLinters: false
glob: "**/*.{html,text,js}{+*,}.erb"
exclude:
- '**/vendor/**/*'
- '**/node_modules/**/*'
linters:
SpaceAroundErbTag:
enabled: true
Rubocop:
enabled: true
exclude:
- "**/vendor/**/*"
- "**/vendor/**/.*"
- "bin/**"
- "db/**/*"
- "spec/**/*"
- "config/**/*"
- "node_modules/**/*"
rubocop_config:
inherit_from:
- .rubocop.yml
AllCops:
DisabledByDefault: true
Layout/InitialIndentation:
Enabled: false
Layout/TrailingEmptyLines:
Enabled: false
Layout/TrailingWhitespace:
Enabled: false
Naming/FileName:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Layout/LineLength:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Layout/FirstHashElementIndentation:
Enabled: false
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jobs:
name: Lint Ruby
uses: alphagov/govuk-infrastructure/.github/workflows/rubocop.yml@main

lint-erb:
name: Lint Ruby
uses: alphagov/govuk-infrastructure/.github/workflows/erblint.yml@main

test-javascript:
name: Test JavaScript
uses: alphagov/govuk-infrastructure/.github/workflows/jasmine.yml@main
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem "rails", "7.1.3.4"
gem "ast"
gem "bootsnap", require: false
gem "dartsass-rails"
gem "erb_lint"
gem "gds-api-adapters"
gem "gds_zendesk"
gem "govspeak"
Expand Down
16 changes: 16 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ GEM
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
better_html (2.1.1)
actionview (>= 6.0)
activesupport (>= 6.0)
ast (~> 2.0)
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.1.8)
binding_of_caller (1.0.1)
debug_inspector (>= 1.2.0)
Expand Down Expand Up @@ -118,6 +125,13 @@ GEM
docile (1.4.0)
domain_name (0.6.20240107)
drb (2.2.1)
erb_lint (0.6.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop (>= 1)
smart_properties
erubi (1.13.0)
execjs (2.9.1)
faker (3.4.1)
Expand Down Expand Up @@ -639,6 +653,7 @@ GEM
plek (>= 1.1.0)
rack (>= 3.0)
rest-client
smart_properties (1.17.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand Down Expand Up @@ -692,6 +707,7 @@ DEPENDENCIES
bootsnap
byebug
dartsass-rails
erb_lint
gds-api-adapters
gds_zendesk
govspeak
Expand Down
1 change: 1 addition & 0 deletions lib/tasks/lint.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
desc "Run all linters"
task lint: [:environment] do
sh "bundle exec erblint --lint-all"
sh "bundle exec rubocop --parallel"
sh "yarn run lint"
end

0 comments on commit 5c3347a

Please sign in to comment.