Skip to content

Commit 190b9b6

Browse files
committed
chore: fix github workflows
1 parent cb217a0 commit 190b9b6

File tree

11 files changed

+55
-18
lines changed

11 files changed

+55
-18
lines changed

.github/workflows/lint.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
uses: ruby/setup-ruby@v1
2020
with:
2121
ruby-version: ${{ matrix.ruby-version }}
22+
- name: Remove vscode gems
23+
run: bundle config set --local without vscode
2224
- name: Install dependencies
2325
run: bundle install
2426
- name: Run rubocop
25-
run: bundle exec rubocop
27+
run: bundle exec rubocop

.github/workflows/test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ jobs:
1919
uses: ruby/setup-ruby@v1
2020
with:
2121
ruby-version: ${{ matrix.ruby-version }}
22+
- name: Remove vscode gems
23+
run: bundle config set --local without vscode
2224
- name: Install dependencies
2325
run: bundle install
26+
- name: Enable file transport in git
27+
run: git config --global protocol.file.allow always
2428
- name: Run tests
2529
run: bundle exec rake test
2630
env:

.rubocop.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
inherit_from: .rubocop_todo.yml
2+
13
inherit_gem:
24
rubocop-rock: defaults.yml
35

.rubocop_todo.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2024-07-10 17:48:07 UTC using RuboCop version 1.65.0.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 2
10+
# Configuration parameters: Severity, Include.
11+
# Include: **/*.gemspec
12+
Gemspec/RubyVersionGlobalsUsage:
13+
Exclude:
14+
- 'autobuild.gemspec'
15+
16+
# Offense count: 1
17+
# This cop supports unsafe autocorrection (--autocorrect-all).
18+
# Configuration parameters: AllowedReceivers.
19+
# AllowedReceivers: Thread.current
20+
Style/HashEachMethods:
21+
Exclude:
22+
- 'lib/autobuild/reporting.rb'

Gemfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ source 'https://rubygems.org'
22

33
gemspec
44

5+
group :lint do
6+
gem 'rubocop', '~> 1.65.0'
7+
gem 'rubocop-rock'
8+
end
9+
510
group :vscode do
611
gem 'debase', '>= 0.2.2.beta10'
712
gem 'pry'
813
gem 'pry-byebug'
9-
gem 'rubocop', '>= 0.6.0'
10-
gem 'rubocop-rock'
1114
gem 'ruby-debug-ide', '>= 0.6.0'
1215
gem 'solargraph'
1316
end

autobuild.gemspec

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Gem::Specification.new do |s|
2424
.reject { |f| f.match(%r{^(test|spec|features)/}) }
2525

2626
s.add_runtime_dependency "concurrent-ruby", "~> 1.1"
27-
s.add_runtime_dependency "net-smtp" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.1.0")
27+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.1.0")
28+
s.add_runtime_dependency "net-smtp"
29+
end
2830
s.add_runtime_dependency "pastel", "~> 0.7.0"
2931
s.add_runtime_dependency "rake", "~> 13.0"
3032
s.add_runtime_dependency 'tty-cursor', '~> 0.7.0'
@@ -36,5 +38,7 @@ Gem::Specification.new do |s|
3638
s.add_development_dependency "minitest", "~> 5.0", ">= 5.0"
3739
s.add_development_dependency "simplecov"
3840
s.add_development_dependency "timecop"
39-
s.add_development_dependency "webrick" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")
41+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")
42+
s.add_development_dependency "webrick"
43+
end
4044
end

lib/autobuild/import/archive.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def checkout(package, options = Hash.new) # :nodoc:
537537
cmd = ['-o', cachefile, '-d', main_dir]
538538
package.run(:import, Autobuild.tool('unzip'), *cmd)
539539

540-
archive_dir = (self.archive_dir || File.basename(package.name))
540+
archive_dir = self.archive_dir || File.basename(package.name)
541541
if archive_dir != File.basename(package.srcdir)
542542
FileUtils.rm_rf File.join(package.srcdir)
543543
FileUtils.mv File.join(base_dir, archive_dir), package.srcdir

lib/autobuild/import/git-lfs.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def self.lfs_setup(importer, package)
3838
end
3939

4040
Git.add_post_hook(always: true) do |importer, package|
41-
wants_lfs = (importer.options[:lfs] != false && importer.uses_lfs?(package))
41+
wants_lfs = importer.options[:lfs] != false && importer.uses_lfs?(package)
4242
if wants_lfs && !Git.lfs_installed?
4343
Autobuild.warn "#{package.name} uses git LFS but it is not installed, "\
4444
"files may be missing from checkout"

lib/autobuild/importer.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ def patches
245245
[[@options[:patches], 0]]
246246
end
247247

248-
single_patch = (patches.size == 2 &&
249-
patches[0].respond_to?(:to_str) &&
250-
patches[1].respond_to?(:to_int))
248+
single_patch = patches.size == 2 &&
249+
patches[0].respond_to?(:to_str) &&
250+
patches[1].respond_to?(:to_int)
251251

252252
patches = [patches] if single_patch
253253
patches.map do |obj|

lib/autobuild/mail_reporter.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ def default_mail
2727
def initialize(config)
2828
super()
2929

30-
@from_email = (config[:from] || default_mail)
31-
@to_email = (config[:to] || default_mail)
30+
@from_email = config[:from] || default_mail
31+
@to_email = config[:to] || default_mail
3232
@subject =
3333
config[:subject] ||
3434
"Build %result% on #{Socket.gethostname} at %time%"
3535
@only_errors = config[:only_errors]
36-
@smtp_hostname = (config[:smtp] || "localhost")
36+
@smtp_hostname = config[:smtp] || "localhost"
3737
@smtp_port = Integer(config[:port] || Socket.getservbyname('smtp'))
3838
end
3939

lib/autobuild/packages/cmake.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ def define(name, value)
165165
end
166166

167167
DOXYGEN_ACCEPTED_VARIABLES = {
168-
'@CMAKE_SOURCE_DIR@' => ->(pkg) { pkg.srcdir },
169-
'@PROJECT_SOURCE_DIR@' => ->(pkg) { pkg.srcdir },
170-
'@CMAKE_BINARY_DIR@' => ->(pkg) { pkg.builddir },
171-
'@PROJECT_BINARY_DIR@' => ->(pkg) { pkg.builddir },
172-
'@PROJECT_NAME@' => ->(pkg) { pkg.name }
168+
'@CMAKE_SOURCE_DIR@' => lambda(&:srcdir),
169+
'@PROJECT_SOURCE_DIR@' => lambda(&:srcdir),
170+
'@CMAKE_BINARY_DIR@' => lambda(&:builddir),
171+
'@PROJECT_BINARY_DIR@' => lambda(&:builddir),
172+
'@PROJECT_NAME@' => lambda(&:name)
173173
}.freeze
174174

175175
class << self

0 commit comments

Comments
 (0)