Skip to content

Commit 2cd2de4

Browse files
committed
ci: add stanardrb linting
1 parent a0da498 commit 2cd2de4

File tree

5 files changed

+101
-50
lines changed

5 files changed

+101
-50
lines changed

.github/workflows/pronto.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pronto
2+
on: [pull_request_target]
3+
4+
jobs:
5+
pronto:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout code
9+
uses: actions/checkout@v2
10+
- run: |
11+
git fetch --no-tags --prune --depth=10 origin +refs/heads/*:refs/remotes/origin/*
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
bundler-cache: true
15+
- run: gem install pronto pronto-rubocop
16+
- run: pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
17+
env:
18+
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
19+
PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}"
20+
BUNDLE_PATH: "vendor/bundle"

.rubocop.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require:
2+
- standard
3+
- standard-custom
4+
- standard-performance
5+
- rubocop-performance
6+
7+
inherit_gem:
8+
standard: config/base.yml
9+
standard-custom: config/base.yml
10+
standard-performance: config/base.yml
11+
12+
AllCops:
13+
NewCops: enable
14+
Exclude:
15+
- node_modules/**/*
16+
- public/**/*
17+
- vendor/**/*

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22

33
gem "faraday", "~> 1.10"
44
gem "faraday_middleware"

Gemfile.lock

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
netbox-client-ruby (0.10.0)
4+
netbox-client-ruby (0.10.1)
55
dry-configurable (~> 1)
66
faraday (>= 0.11.0, < 3)
77
faraday-detailed_logger (~> 2.1)
@@ -49,22 +49,23 @@ GEM
4949
faraday_middleware (1.2.0)
5050
faraday (~> 1.0)
5151
ipaddress (0.8.3)
52+
json (2.7.2)
53+
language_server-protocol (3.17.0.3)
54+
lint_roller (1.1.0)
5255
method_source (1.0.0)
5356
multipart-post (2.3.0)
5457
openssl (3.2.0)
55-
parallel (1.23.0)
56-
parser (3.2.2.3)
58+
parallel (1.26.3)
59+
parser (3.3.5.0)
5760
ast (~> 2.4.1)
5861
racc
5962
pry (0.14.2)
6063
coderay (~> 1.1)
6164
method_source (~> 1.0)
62-
racc (1.7.1)
65+
racc (1.8.1)
6366
rainbow (3.1.1)
6467
rake (13.0.6)
65-
regexp_parser (2.8.1)
66-
rexml (3.3.6)
67-
strscan
68+
regexp_parser (2.9.2)
6869
rspec (3.12.0)
6970
rspec-core (~> 3.12.0)
7071
rspec-expectations (~> 3.12.0)
@@ -78,28 +79,41 @@ GEM
7879
diff-lcs (>= 1.2.0, < 2.0)
7980
rspec-support (~> 3.12.0)
8081
rspec-support (3.12.1)
81-
rubocop (0.93.1)
82+
rubocop (1.66.1)
83+
json (~> 2.3)
84+
language_server-protocol (>= 3.17.0)
8285
parallel (~> 1.10)
83-
parser (>= 2.7.1.5)
86+
parser (>= 3.3.0.2)
8487
rainbow (>= 2.2.2, < 4.0)
85-
regexp_parser (>= 1.8)
86-
rexml
87-
rubocop-ast (>= 0.6.0)
88+
regexp_parser (>= 2.4, < 3.0)
89+
rubocop-ast (>= 1.32.2, < 2.0)
8890
ruby-progressbar (~> 1.7)
89-
unicode-display_width (>= 1.4.0, < 2.0)
90-
rubocop-ast (1.29.0)
91-
parser (>= 3.2.1.0)
92-
rubocop-rspec (1.44.1)
93-
rubocop (~> 0.87)
94-
rubocop-ast (>= 0.7.1)
91+
unicode-display_width (>= 2.4.0, < 3.0)
92+
rubocop-ast (1.32.3)
93+
parser (>= 3.3.1.0)
94+
rubocop-performance (1.22.1)
95+
rubocop (>= 1.48.1, < 2.0)
96+
rubocop-ast (>= 1.31.1, < 2.0)
9597
ruby-progressbar (1.13.0)
9698
ruby2_keywords (0.0.5)
97-
strscan (3.1.0)
98-
unicode-display_width (1.8.0)
99+
standard (1.41.1)
100+
language_server-protocol (~> 3.17.0.2)
101+
lint_roller (~> 1.0)
102+
rubocop (~> 1.66.0)
103+
standard-custom (~> 1.0.0)
104+
standard-performance (~> 1.5)
105+
standard-custom (1.0.2)
106+
lint_roller (~> 1.0)
107+
rubocop (~> 1.50)
108+
standard-performance (1.5.0)
109+
lint_roller (~> 1.1)
110+
rubocop-performance (~> 1.22.0)
111+
unicode-display_width (2.6.0)
99112
zeitwerk (2.6.12)
100113

101114
PLATFORMS
102115
arm64-darwin-22
116+
arm64-darwin-23
103117
x86_64-linux
104118

105119
DEPENDENCIES
@@ -110,8 +124,8 @@ DEPENDENCIES
110124
pry (~> 0.10)
111125
rake (~> 13)
112126
rspec (~> 3.5)
113-
rubocop (~> 0.48)
114-
rubocop-rspec (~> 1.15)
127+
standard (~> 1.31)
128+
standard-performance (~> 1.2)
115129

116130
BUNDLED WITH
117131
2.4.10

netbox-client-ruby.gemspec

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
lib = File.expand_path('lib', __dir__)
1+
lib = File.expand_path("lib", __dir__)
22
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
33

44
Gem::Specification.new do |spec|
5-
spec.name = 'netbox-client-ruby'
6-
spec.version = `git describe --tags --match="v[0-9]*" --abbrev=0`.strip.delete_prefix("v")
5+
spec.name = "netbox-client-ruby"
6+
spec.version = `git describe --tags --match="v[0-9]*" --abbrev=0`.strip.delete_prefix("v")
77

8-
spec.summary = 'A read/write client for Netbox v2.'
9-
spec.homepage = 'https://github.com/ninech/netbox-client-ruby'
10-
spec.license = 'MIT'
8+
spec.summary = "A read/write client for Netbox v2."
9+
spec.homepage = "https://github.com/ninech/netbox-client-ruby"
10+
spec.license = "MIT"
1111

12-
spec.authors = ['Christian Mäder']
13-
spec.email = ['christian.maeder@nine.ch']
12+
spec.authors = ["Nine Internet Solutions AG"]
13+
spec.email = ["support@nine.ch"]
1414

1515
if spec.respond_to?(:metadata)
16-
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
1717
end
1818

1919
spec.files = `git ls-files -z`.split("\x0").reject do |f|
2020
f.match(%r{^(test|spec|features)/})
2121
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.required_ruby_version = '>= 2.7.0'
27-
28-
spec.add_runtime_dependency 'dry-configurable', '~> 1'
29-
spec.add_runtime_dependency 'faraday', '>= 0.11.0', '< 3'
30-
spec.add_runtime_dependency 'faraday-detailed_logger', '~> 2.1'
31-
spec.add_runtime_dependency 'ipaddress', '~> 0.8', '>= 0.8.3'
32-
spec.add_runtime_dependency 'openssl', '>= 2.0.5'
33-
34-
spec.add_development_dependency 'bundler', '~> 2.1'
35-
spec.add_development_dependency 'pry', '~> 0.10'
36-
spec.add_development_dependency 'rake', '~> 13'
37-
spec.add_development_dependency 'rspec', '~> 3.5'
38-
spec.add_development_dependency 'rubocop', '~> 0.48'
39-
spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
22+
spec.bindir = "exe"
23+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24+
spec.require_paths = ["lib"]
25+
26+
spec.required_ruby_version = ">= 2.7.0"
27+
28+
spec.add_runtime_dependency "dry-configurable", "~> 1"
29+
spec.add_runtime_dependency "faraday", ">= 0.11.0", "< 3"
30+
spec.add_runtime_dependency "faraday-detailed_logger", "~> 2.1"
31+
spec.add_runtime_dependency "ipaddress", "~> 0.8", ">= 0.8.3"
32+
spec.add_runtime_dependency "openssl", ">= 2.0.5"
33+
34+
spec.add_development_dependency "bundler", "~> 2.1"
35+
spec.add_development_dependency "pry", "~> 0.10"
36+
spec.add_development_dependency "rake", "~> 13"
37+
spec.add_development_dependency "rspec", "~> 3.5"
38+
spec.add_development_dependency "standard", "~> 1.31"
39+
spec.add_development_dependency "standard-performance", "~> 1.2"
4040
end

0 commit comments

Comments
 (0)