Browse Source

Add linter: rubocop

develop
Bèr Kessels 1 year ago
parent
commit
45c21d119b
4 changed files with 34 additions and 8 deletions
  1. 3
    0
      .rubocop.yml
  2. 8
    6
      Gemfile
  3. 18
    0
      Gemfile.lock
  4. 5
    2
      Makefile

+ 3
- 0
.rubocop.yml View File

@@ -0,0 +1,3 @@
1
+Metrics/BlockLength:
2
+  Exclude:
3
+    - test/**/*_test.rb # We define specs in blocks, which by nature get large.

+ 8
- 6
Gemfile View File

@@ -1,15 +1,17 @@
1 1
 # frozen_string_literal: true
2 2
 
3
-source "https://rubygems.org"
3
+source 'https://rubygems.org'
4 4
 
5
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
+git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6 6
 
7
-gem "opening_hours_converter"
7
+gem 'opening_hours_converter'
8 8
 
9
-gem "nominatim", github: "lukaszsliwa/nominatim"
9
+gem 'nominatim', github: 'lukaszsliwa/nominatim'
10 10
 
11
-gem "semver"
11
+gem 'semver'
12 12
 
13 13
 group :development, :test do
14
-  gem "minitest"
14
+  gem 'minitest'
15
+
16
+  gem 'rubocop'
15 17
 end

+ 18
- 0
Gemfile.lock View File

@@ -9,15 +9,32 @@ GIT
9 9
 GEM
10 10
   remote: https://rubygems.org/
11 11
   specs:
12
+    ast (2.4.0)
12 13
     faraday (0.15.4)
13 14
       multipart-post (>= 1.2, < 3)
15
+    jaro_winkler (1.5.2)
14 16
     json (2.1.0)
15 17
     minitest (5.11.3)
16 18
     multi_json (1.13.1)
17 19
     multipart-post (2.0.0)
18 20
     opening_hours_converter (1.7.20)
19 21
       json
22
+    parallel (1.13.0)
23
+    parser (2.6.0.0)
24
+      ast (~> 2.4.0)
25
+    powerpack (0.1.2)
26
+    rainbow (3.0.0)
27
+    rubocop (0.64.0)
28
+      jaro_winkler (~> 1.5.1)
29
+      parallel (~> 1.10)
30
+      parser (>= 2.5, != 2.5.1.1)
31
+      powerpack (~> 0.1)
32
+      rainbow (>= 2.2.2, < 4.0)
33
+      ruby-progressbar (~> 1.7)
34
+      unicode-display_width (~> 1.4.0)
35
+    ruby-progressbar (1.10.0)
20 36
     semver (1.0.1)
37
+    unicode-display_width (1.4.1)
21 38
 
22 39
 PLATFORMS
23 40
   ruby
@@ -26,6 +43,7 @@ DEPENDENCIES
26 43
   minitest
27 44
   nominatim!
28 45
   opening_hours_converter
46
+  rubocop
29 47
   semver
30 48
 
31 49
 BUNDLED WITH

+ 5
- 2
Makefile View File

@@ -6,16 +6,19 @@ TODAY=$(shell date +%F)
6 6
 # You want latexmk to *always* run, because make does not have all the info.
7 7
 # Also, include non-file targets in .PHONY so they are run regardless of any
8 8
 # file of the given name existing.
9
-.PHONY: all test clean setup ruby packages preprocess
9
+.PHONY: all test lint clean setup ruby packages preprocess
10 10
 
11 11
 # The first rule in a Makefile is the one executed by default ("make"). It
12 12
 # should always be the "all" rule, so that "make" and "make all" are identical.
13
-all: test
13
+all: lint test
14 14
 
15 15
 # CUSTOM BUILD RULES
16 16
 test:
17 17
 	$(CMD_PREFIX) ruby -I test test/**/*_test.rb
18 18
 
19
+lint:
20
+	$(CMD_PREFIX) rubocop
21
+
19 22
 clean:
20 23
 	# noop
21 24
 

Loading…
Cancel
Save