Skip to content

Commit

Permalink
Allow linting subset of files with bin/lint and fix deprecation errors (
Browse files Browse the repository at this point in the history
  • Loading branch information
coalest authored Dec 14, 2024
1 parent 5538cc5 commit 1fce009
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Before submitting a pull request, run all tests and lints. Fix any broken tests
- Once your first PR has been merged, all commits pushed to an open PR will also run these workflows.
#### Local testing
- Run all lints with `bin/lint`.
- Run all lints with `bin/lint`. (You can lint a single file/folder with `bin/lint {path_to_folder_or_file}`.)
- Run all tests with `bundle exec rspec`
- You can run a single test with `bundle exec rspec {path_to_test_name}_spec.rb` or on a specific line by appending `:LineNumber`
- If you need to skip a failing test, place `pending("Reason you are skipping the test")` into the `it` block rather than skipping with `xit`. This will allow rspec to deliver the error message without causing the test suite to fail.
Expand Down
16 changes: 14 additions & 2 deletions bin/lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#!/bin/bash

bundle exec rubocop -A
bundle exec erblint --lint-all -a
# Note: Any arguments passed in will be passed along to rubocop or erb_lint
#
# Example to only lint Rails models:
# $ bin/lint app/models
#
echo "Running rubocop"
bundle exec rubocop -A $@

echo "Running erb_lint"
if [ $# -eq 0 ]; then # If no arguments are supplied check all files
bundle exec erb_lint --lint-all -a
else # otherwise pass those arguments along (likely a specific file or folder)
bundle exec erb_lint $@ -a
fi

0 comments on commit 1fce009

Please sign in to comment.