Skip to content

Commit

Permalink
changed pre-commit and README.md to docker compose
Browse files Browse the repository at this point in the history
Also added .erb files to ones checked for linting and testing
  • Loading branch information
niquerio committed Nov 3, 2023
1 parent 0c2ab54 commit f8063a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
#!/bin/sh

set -e
rubyfiles=$(git diff --cached --name-only --diff-filter=ACM "*.rb" "Gemfile" | tr '\n' ' ')
rubyfiles=$(git diff --cached --name-only --diff-filter=ACM "*.rb" "Gemfile" "*.erb" | tr '\n' ' ')
[ -z "$rubyfiles" ] && exit 0

# Standardize all ruby files
echo "🧹 Formatting staged Ruby files using standardrb ($(echo $rubyfiles | wc -w | awk '{print $1}') total)"
echo "$rubyfiles" | xargs docker-compose run --rm web bundle exec standardrb --fix
echo "$rubyfiles" | xargs docker compose run -T --rm web bundle exec standardrb --fix

# Add back the modified/prettified files to staging
echo "$rubyfiles" | xargs git add

echo "📋 Running tests with rspec"
docker-compose run --rm web bundle exec rspec --format progress
docker compose run -T --rm web bundle exec rspec --format progress

exit 0
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ edit .env with the appropriate environment variables
start containers

```bash
docker-compose up -d
docker compose up -d
```

watch then build styles or scripts (optional)

```bash
# styles
docker-compose run --rm web npm run watch-css
docker compose run --rm web npm run watch-css
# scripts
docker-compose run --rm web npm run watch-js
docker compose run --rm web npm run watch-js
```

In a browser, go to http://localhost:4567 to see the website.
Expand Down

0 comments on commit f8063a5

Please sign in to comment.