Sha256: 4652cc7a6c6997996b24cd9e09264bc645737a7652efbb83bc64c13e331d62af

Contents?: true

Size: 779 Bytes

Versions: 1

Compression:

Stored size: 779 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'gazelle_styleguide'
require 'pre-commit/checks/plugin'

module PreCommit
  module Checks
    # Loads environment variables for configuration.
    class Env < Plugin
      def call(staged_files)
        ENV['JSHINT_CONFIG'] = GazelleStyleguide.config_for('jshintrc.json')
        ENV['COFFEELINT_CONFIG'] = GazelleStyleguide.config_for('coffeelint.json')
        ENV['RUBOCOP_CONFIG'] = GazelleStyleguide.config_for('rubocop.yml')
        ENV['CHECKSTYLE_CONFIG'] = GazelleStyleguide.config_for('checkstyle.properties')
        ENV['CHECKSTYLE_CHECKS'] = GazelleStyleguide.config_for('sun_checks.xml')

        nil
      end

      def self.description
        'Load environment variables for linter configuration.'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gazelle_styleguide-0.0.1 lib/plugins/pre_commit/checks/env.rb