Skip to content

Commit

Permalink
Add file consistency linters (#1206)
Browse files Browse the repository at this point in the history
* Lint for trailing whitespace, merge conflicts, and newline at EOF

* Update changelog

* Update changelog message

* Fix potential linter failures
  • Loading branch information
boardfish authored Dec 14, 2021
1 parent 3dfda24 commit 37a26e6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
/test/sandbox/app/components/translatable_component.rb @elia
/test/sandbox/app/components/translatable_component.yml @elia
/test/sandbox/app/components/translations_component.html.erb @elia
/test/sandbox/app/components/translations_component.rb @elia
/test/sandbox/app/components/translations_component.rb @elia
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ name: Lint
on: [pull_request]

jobs:
trailing-whitespace:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check for trailing whitespace
uses: raisedevs/find-trailing-whitespace@restrict-to-plaintext-only
- name: Check for merge conflicts
run: git diff --check
shell: bash
- name: Ensure all files have newline at EOF
uses: Logerfo/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
prose:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Microsoft.Headings = NO
Microsoft.Passive = NO
Microsoft.SentenceLength = NO
Microsoft.Vocab = NO
Microsoft.We = NO
Microsoft.We = NO
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
viewcomponent.org
viewcomponent.org
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ title: Changelog

## main

* Add linters for file consistency.

*Simon Fish*

* Add @boardfish to docs/index.md and sort contributors.

*Simon Fish*
Expand Down
2 changes: 1 addition & 1 deletion docs/logo/readme-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/logo/readme-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/rails/generators/component/templates/component.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class <%= class_name %>Component < <%= parent_class %>
<%= initialize_body %>
end
<%- end -%>
<%- if initialize_call_method_for_inline? -%>
<%- if initialize_call_method_for_inline? -%>
def call
content_tag :h1, "Hello world!"<%= ", data: { controller: \"#{stimulus_controller}\" }" if options["stimulus"] %>
end
Expand Down

0 comments on commit 37a26e6

Please sign in to comment.