Browse Source
Added haml-lint and fix warnings (#2773)
Added haml-lint and fix warnings (#2773)
* add haml_lint to Gemfile * add .haml-lint.yml * fix warnings of haml_lintmaster

committed by
Eugen Rochko

39 changed files with 207 additions and 90 deletions
-
108.haml-lint.yml
-
1Gemfile
-
9Gemfile.lock
-
2app/views/about/_contact.html.haml
-
4app/views/about/_registration.html.haml
-
4app/views/about/more.html.haml
-
6app/views/about/show.html.haml
-
2app/views/accounts/_grid_card.html.haml
-
4app/views/accounts/_header.html.haml
-
2app/views/admin/accounts/_card.html.haml
-
6app/views/admin/reports/_report.html.haml
-
2app/views/admin/settings/edit.html.haml
-
2app/views/application/_flashes.html.haml
-
2app/views/auth/confirmations/new.html.haml
-
6app/views/auth/passwords/edit.html.haml
-
2app/views/auth/passwords/new.html.haml
-
6app/views/auth/registrations/edit.html.haml
-
6app/views/auth/registrations/new.html.haml
-
2app/views/auth/sessions/new.html.haml
-
2app/views/auth/sessions/two_factor.html.haml
-
2app/views/authorize_follows/_card.html.haml
-
2app/views/errors/403.html.haml
-
2app/views/errors/404.html.haml
-
4app/views/home/index.html.haml
-
2app/views/layouts/admin.html.haml
-
23app/views/layouts/application.html.haml
-
2app/views/layouts/auth.html.haml
-
4app/views/layouts/embedded.html.haml
-
12app/views/layouts/error.html.haml
-
6app/views/layouts/public.html.haml
-
2app/views/oauth/authorizations/new.html.haml
-
2app/views/oauth/authorized_applications/index.html.haml
-
4app/views/settings/profiles/show.html.haml
-
2app/views/settings/two_factor_authentication/confirmations/new.html.haml
-
10app/views/stream_entries/_detailed_status.html.haml
-
2app/views/stream_entries/_media.html.haml
-
4app/views/stream_entries/_simple_status.html.haml
-
32app/views/stream_entries/_status.html.haml
-
2app/views/tags/show.html.haml
@ -0,0 +1,108 @@ |
|||
# Whether to ignore frontmatter at the beginning of HAML documents for |
|||
# frameworks such as Jekyll/Middleman |
|||
skip_frontmatter: false |
|||
|
|||
exclude: |
|||
- 'vendor/**/*' |
|||
- 'spec/**/*' |
|||
- 'lib/templates/**/*' |
|||
- 'app/views/kaminari/**/*' |
|||
|
|||
linters: |
|||
AltText: |
|||
enabled: false |
|||
|
|||
ClassAttributeWithStaticValue: |
|||
enabled: true |
|||
|
|||
ClassesBeforeIds: |
|||
enabled: true |
|||
|
|||
ConsecutiveComments: |
|||
enabled: true |
|||
|
|||
ConsecutiveSilentScripts: |
|||
enabled: true |
|||
max_consecutive: 2 |
|||
|
|||
EmptyObjectReference: |
|||
enabled: true |
|||
|
|||
EmptyScript: |
|||
enabled: true |
|||
|
|||
FinalNewline: |
|||
enabled: true |
|||
present: true |
|||
|
|||
HtmlAttributes: |
|||
enabled: true |
|||
|
|||
ImplicitDiv: |
|||
enabled: true |
|||
|
|||
LeadingCommentSpace: |
|||
enabled: true |
|||
|
|||
LineLength: |
|||
enabled: false |
|||
max: 80 |
|||
|
|||
MultilinePipe: |
|||
enabled: true |
|||
|
|||
MultilineScript: |
|||
enabled: true |
|||
|
|||
ObjectReferenceAttributes: |
|||
enabled: true |
|||
|
|||
RuboCop: |
|||
enabled: true |
|||
# These cops are incredibly noisy when it comes to HAML templates, so we |
|||
# ignore them. |
|||
ignored_cops: |
|||
- Lint/BlockAlignment |
|||
- Lint/EndAlignment |
|||
- Lint/Void |
|||
- Metrics/BlockLength |
|||
- Metrics/LineLength |
|||
- Style/AlignParameters |
|||
- Style/BlockNesting |
|||
- Style/ElseAlignment |
|||
- Style/EndOfLine |
|||
- Style/FileName |
|||
- Style/FinalNewline |
|||
- Style/FrozenStringLiteralComment |
|||
- Style/IfUnlessModifier |
|||
- Style/IndentationWidth |
|||
- Style/Next |
|||
- Style/TrailingBlankLines |
|||
- Style/TrailingWhitespace |
|||
- Style/WhileUntilModifier |
|||
|
|||
RubyComments: |
|||
enabled: true |
|||
|
|||
SpaceBeforeScript: |
|||
enabled: true |
|||
|
|||
SpaceInsideHashAttributes: |
|||
enabled: true |
|||
style: space |
|||
|
|||
Indentation: |
|||
enabled: true |
|||
character: space # or tab |
|||
|
|||
TagName: |
|||
enabled: true |
|||
|
|||
TrailingWhitespace: |
|||
enabled: true |
|||
|
|||
UnnecessaryInterpolation: |
|||
enabled: true |
|||
|
|||
UnnecessaryStringOutput: |
|||
enabled: true |
@ -1,3 +1,3 @@ |
|||
- user_facing_flashes.each do |key, value| |
|||
.flash-message{class: key} |
|||
.flash-message{ class: key } |
|||
%strong= value |
@ -1,6 +1,6 @@ |
|||
- content_for :header_tags do |
|||
%script#initial-state{:type => 'application/json'}!= json_escape(render(file: 'home/initial_state', formats: :json)) |
|||
%script#initial-state{ type: 'application/json' }!= json_escape(render(file: 'home/initial_state', formats: :json)) |
|||
|
|||
= javascript_pack_tag 'application', integrity: true, crossorigin: 'anonymous' |
|||
|
|||
.app-holder#mastodon{ data: { props: Oj.dump(default_props) }} |
|||
.app-holder#mastodon{ data: { props: Oj.dump(default_props) } } |
@ -1,7 +1,7 @@ |
|||
!!! 5 |
|||
%html{:lang => I18n.locale} |
|||
%html{ lang: I18n.locale } |
|||
%head |
|||
%meta{:charset => 'utf-8'}/ |
|||
%meta{ charset: 'utf-8' }/ |
|||
= stylesheet_link_tag 'application', media: 'all' |
|||
= javascript_pack_tag 'public', integrity: true, crossorigin: 'anonymous' |
|||
%body.embed |
|||
|
@ -1,4 +1,4 @@ |
|||
.media-item |
|||
= link_to media.remote_url.blank? ? media.file.url(:original) : media.remote_url, style: media.image? ? "background-image: url(#{media.file.url(:original)})" : "", target: '_blank', rel: 'noopener', class: "u-#{media.video? || media.gifv? ? 'video' : 'photo'}" do |
|||
= link_to media.remote_url.blank? ? media.file.url(:original) : media.remote_url, style: media.image? ? "background-image: url(#{media.file.url(:original)})" : '', target: '_blank', rel: 'noopener', class: "u-#{media.video? || media.gifv? ? 'video' : 'photo'}" do |
|||
- unless media.image? |
|||
%video{ src: media.file.url(:original), autoplay: true, loop: true }/ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue