ikusei_linters 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9230b13944e419f8970ba2d7f63722b0fedd1939
4
+ data.tar.gz: 7e24b6c93afd2708cd01f16f98b79bd3ab487255
5
+ SHA512:
6
+ metadata.gz: 82331ff6412ffc56866a3d72f1d673162e22786c2ab0fb440110e14725d0a41178d1f00ce6195e4bc056f37be9ae49b2a4b57b60919ca03988c3015dbdbafdbb
7
+ data.tar.gz: ac72aa18b9a20d2720e3ed4fee88ace4464eaf5d5cbb53f495bab5f830dc6d489c3846de8aafcfbbd502934a87fcd1ac6adc7ff7d7c060f01b1cda3b34bd7d85
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in ikusei-linters.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 ikusei GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Linters
2
+
3
+ This are our configuration files for [scss-lint](https://github.com/brigade/scss-lint), [Rubocop](https://github.com/bbatsov/rubocop) and [ESLint](http://eslint.org/).
4
+ If you want to work on project's together with ikusei, please take the time to set up your environment to use these configuration files.
5
+
6
+ If you download them, please make sure, to rename them and put a leading . in their names.
7
+
8
+ ```
9
+ eslintrc => .eslintrc
10
+ rubocop.yml => .rubocop.yml
11
+ scss-lint.yml => .sccs-lint.yml
12
+ ```
13
+
14
+
15
+ ## Usage in Rails
16
+
17
+ Add the gem to your Gemfile
18
+
19
+ ```
20
+ gem "ikusei-linters", github: "ikuseiGmbH/linters"
21
+ ```
22
+
23
+ Run the rake task
24
+
25
+ ```
26
+ bundle exec rake ikusei:lint
27
+ ```
28
+
29
+ Each linter has a own task, so the following works, too:
30
+
31
+ ```
32
+ bundle exec rake ikusei:rubocop
33
+ ```
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require "bundler/gem_tasks"
2
+ task default: :spec
3
+
4
+ import "./lib/ikusei/tasks/lint.rake"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ikusei/linters"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/eslintrc ADDED
@@ -0,0 +1,15 @@
1
+ extends: airbnb
2
+ parser: "babel-eslint"
3
+ env:
4
+ browser: true
5
+ mocha: true
6
+ es6: true
7
+ commonjs: true
8
+ jquery: true
9
+ plugins: [react]
10
+ rules:
11
+ no-console: 0
12
+ func-names: 0
13
+ comma-dangle: [2, never]
14
+ indent: [2, 2, { 'SwitchCase': 1, 'VariableDeclarator': { "var": 2, "let": 2, "const": 3 } }]
15
+ one-var: [2, "always"]
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "ikusei/linters/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ikusei_linters"
8
+ spec.version = Ikusei::Linters::VERSION
9
+ spec.authors = ["Niklas Hofer", "Holger Frohloff"]
10
+ spec.email = ["info@ikusei.de"]
11
+ spec.license = "MIT"
12
+ spec.summary = "Collection of all linter configuration files for the ikusei GmbH style
13
+ guides."
14
+ spec.description = "This are our configuration files for scss-lint, Rubocop and ESLint. If you
15
+ want to work on project's together with ikusei, please take the time to set up your environment to
16
+ use these configuration files."
17
+ spec.homepage = "https://github.com/ikuseiGmbH/linters"
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
+ f.match(%r{^(test|spec|features)/})
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.12"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_dependency "scss_lint", "~> 0.50"
29
+ spec.add_dependency "eslintrb", "~> 2.1"
30
+ spec.add_dependency "rubocop", "~> 0.42"
31
+ end
@@ -0,0 +1,6 @@
1
+ require "rails"
2
+ class Ikusei::Linters::Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ load "ikusei/tasks/lint.rake"
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ require "ikusei.rb"
2
+ module Ikusei::Linters
3
+ VERSION = "0.1.0".freeze
4
+ end
@@ -0,0 +1,5 @@
1
+ require "ikusei/linters/version"
2
+
3
+ module Ikusei::Linters
4
+ require "ikusei/linters/railtie" if defined?(Rails)
5
+ end
@@ -0,0 +1,30 @@
1
+ require "eslintrb/eslinttask"
2
+ require "yaml"
3
+
4
+ namespace :ikusei do
5
+ desc "Run all linters requested by ikusei"
6
+ task lint: [:rubocop, :eslint, :scss_lint] do
7
+ $stderr.puts "lint everything"
8
+ end
9
+
10
+ desc "Run eslint with ikusei configuration"
11
+ Eslintrb::EslintTask.new :eslint do |t|
12
+ root = File.expand_path(File.join(__FILE__, "../../../.."))
13
+
14
+ t.pattern = "app/assets/javascripts/**/*.js"
15
+ t.options = YAML.load(File.read(root + "/eslintrc"))
16
+ end
17
+
18
+ desc "Run rubocop with ikusei configuration"
19
+ task :rubocop do
20
+ root = File.expand_path(File.join(__FILE__, "../../../.."))
21
+ system("bundle exec rubocop -c #{root}/rubocop.yml")
22
+ end
23
+
24
+ desc "Run scss-lint with ikusei configuration"
25
+ task :scss_lint do
26
+ root = File.expand_path(File.join(__FILE__, "../../../.."))
27
+ pattern = "app/assets/stylesheets"
28
+ system("bundle exec scss-lint -c #{root}/scss-lint.yml #{pattern}")
29
+ end
30
+ end
data/lib/ikusei.rb ADDED
@@ -0,0 +1,2 @@
1
+ module Ikusei
2
+ end