File: rubocop

package info (click to toggle)
ruby-active-model-serializers 0.10.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,752 kB
  • sloc: ruby: 13,138; sh: 53; makefile: 6
file content (38 lines) | stat: -rwxr-xr-x 796 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
#
# Usage:
#   bin/rubocop [-A|-t|-h]
#   bin/rubocop [file or path] [cli options]
#
# Options:
#  Autocorrect    -A
#  AutoGenConfig  -t
#  Usage          -h,--help,help

set -e

case $1 in
  -A)
     echo "Rubocop autocorrect is ON" >&2
     bundle exec rake -f lib/tasks/rubocop.rake rubocop:auto_correct
     ;;

  -t)
     echo "Rubocop is generating a new TODO" >&2
     bundle exec rake -f lib/tasks/rubocop.rake rubocop:auto_gen_config
     ;;

  -h|--help|help)
     sed -ne '/^#/!q;s/.\{1,2\}//;1d;p' < "$0"
     ;;

  *)
     # with no args, run vanilla rubocop
     # else assume we're passing in arbitrary arguments
     if [ -z "$1" ]; then
       bundle exec rake -f lib/tasks/rubocop.rake rubocop
     else
       bundle exec rubocop "$@"
     fi
     ;;
esac