Sha256: 80ba96700c5e3f21074f5b42e60588caab0dfe51f498b0997349e446560e3e8c

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 Bytes

Contents

#!/usr/bin/env bash

RESET_COLOR='\033[0m'
HIGHLIGHT_COLOR='\033[0;35m'
SUCCESS_COLOR='\033[0;32m'
ERROR_COLOR='\033[0;31m'

clear

# linter configuration paths
RUBOCOP_CONFIG=.rubocop.yml

# Checking for existence of configuration files...
test -e ${RUBOCOP_CONFIG} || { echo -e "${ERROR_COLOR}"ERROR: ${RUBOCOP_CONFIG} not found."${RESET_COLOR}"; exit 1; }

# Running linters
echo -e "${HIGHLIGHT_COLOR}"Linting Ruby on Rails using RuboCop..."${RESET_COLOR}"
if [[ "$1" == "--no-fix" ]]; then
        bundle exec rubocop || { valid=false; }
else
        bundle exec rubocop --autocorrect-all  || { valid=false; }
fi

# Printing summary
if [[ "$valid" == false ]]; then
  echo -e "${ERROR_COLOR}"ERROR: Lint errors have been found in your code."${RESET_COLOR}"
  exit 1
else
  echo -e "${SUCCESS_COLOR}"SUCCESS: All lints have completed without errors."${RESET_COLOR}"
fi

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fillable-pdf-0.9.6 bin/lint