Commit 6ced445

mo <mo@mokhan.ca>
2021-02-04 23:38:51
Annual cleanup (#7)
* chore: split lint into audit and style * chore: upgrade gems * chore: remove byebug * chore: set min activemodel to 6.0 * chore: specify min parslet 2.0
1 parent 5ff966a
.github/workflows/ci.yml
@@ -1,36 +1,41 @@
 name: ci
-on: [push]
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
 jobs:
-  build:
+  test:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        ruby: [ '2.5', '2.6', '2.7' ]
-    name: RSpec Ruby ${{ matrix.ruby }}
+        ruby-version: ['2.5', '2.6', '2.7']
     steps:
       - uses: actions/checkout@v2
+      - name: Set up Ruby
+        uses: ruby/setup-ruby@v1
         with:
-          lfs: true
-          submodules: recursive
-      - uses: actions/setup-ruby@v1
-        with:
-          ruby-version: ${{ matrix.ruby }}
-      - name: setup
-        run: ./bin/setup
-      - name: test
-        run: ./bin/test
-  lint:
+          ruby-version: ${{ matrix.ruby-version }}
+          bundler-cache: true
+      - name: Running tests…
+        run: sh bin/test
+  style:
     runs-on: ubuntu-latest
-    name: Lint
     steps:
       - uses: actions/checkout@v2
+      - uses: ruby/setup-ruby@v1
         with:
-          lfs: true
-          submodules: recursive
-      - uses: actions/setup-ruby@v1
+          ruby-version: '2.7'
+          bundler-cache: true
+      - name: Running style checks…
+        run: sh bin/style
+  audit:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: ruby/setup-ruby@v1
         with:
-          ruby-version: 2.7
-      - name: setup
-        run: ./bin/setup
-      - name: lint
-        run: ./bin/lint
+          ruby-version: '2.7'
+          bundler-cache: true
+      - name: Running audit…
+        run: sh bin/audit
bin/lint → bin/audit
@@ -4,6 +4,4 @@ set -e
 
 cd "$(dirname "$0")/.."
 
-export RUBYOPT='-W0'
-
-bundle exec rake lint
+bundle exec rake bundle:audit
bin/cibuild
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-set -e
-
-[ -z "$DEBUG" ] || set -x
-
-cd "$(dirname "$0")/.."
-export RUBY_GC_MALLOC_LIMIT=79000000
-export RUBY_GC_HEAP_INIT_SLOTS=800000
-export RUBY_HEAP_FREE_MIN=100000
-export RUBY_HEAP_SLOTS_INCREMENT=400000
-export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
-
-echo ["$(date "+%H:%M:%S")"] "==> Running setup…"
-bin/setup
-
-echo ["$(date "+%H:%M:%S")"] "==> Running tests…"
-bin/test
-
-echo ["$(date "+%H:%M:%S")"] "==> Running linters…"
-bin/lint
bin/setup
@@ -1,7 +1,6 @@
-#!/usr/bin/env bash
+#!/bin/sh
 set -euo pipefail
 IFS=$'\n\t'
 
 ruby -v
-gem install bundler --conservative -v '~> 2.0'
-bundle check || bundle install --jobs "$(sysctl -n hw.ncpu || nproc)"
+bundle check || bundle install
bin/shipit
@@ -4,5 +4,4 @@ set -e
 
 cd "$(dirname "$0")/.."
 
-bin/cibuild
 bundle exec rake release
bin/style
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+bundle exec rake rubocop
spec/spec_helper.rb
@@ -4,7 +4,6 @@ require 'bundler/setup'
 require 'scim/kit'
 require 'ffaker'
 require 'json'
-require 'byebug'
 require 'parslet/convenience'
 require 'parslet/rig/rspec'
 require 'webmock/rspec'
.gitlab-ci.yml
@@ -1,11 +0,0 @@
-image: ruby:2.6
-
-before_script:
-  - apt-get update && apt-get install -y locales
-  - echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
-  - locale-gen
-  - export LC_ALL=en_US.UTF-8
-
-rspec:
-  script:
-    - bin/cibuild
.rubocop.yml
@@ -43,6 +43,10 @@ Lint/RaiseException:
 Lint/StructNewOverride:
   Enabled: true
 
+Metrics/AbcSize:
+  Exclude:
+    - 'lib/scim/kit/v2/service_provider_configuration.rb'
+
 Metrics/BlockLength:
   Exclude:
     - '*.gemspec'
@@ -72,6 +76,10 @@ Style/HashTransformKeys:
 Style/HashTransformValues:
   Enabled: true
 
+Style/IfUnlessModifier:
+  Exclude:
+    - 'lib/scim/kit/v2/attribute.rb'
+
 Style/StringLiterals:
   EnforcedStyle: 'single_quotes'
 
@@ -84,6 +92,9 @@ Style/TrailingCommaInHashLiteral:
 RSpec/FilePath:
   Enabled: false
 
+RSpec/MultipleMemoizedHelpers:
+  Enabled: false
+
 RSpec/NamedSubject:
   Enabled: false
 
Gemfile.lock
@@ -2,88 +2,91 @@ PATH
   remote: .
   specs:
     scim-kit (0.5.1)
-      activemodel (>= 5.2.0)
+      activemodel (~> 6.1)
       net-hippie (~> 0.3)
-      parslet (>= 1.8, < 3.0)
+      parslet (~> 2.0)
       tilt (~> 2.0)
       tilt-jbuilder (~> 0.7)
 
 GEM
   remote: https://rubygems.org/
   specs:
-    activemodel (6.0.3.1)
-      activesupport (= 6.0.3.1)
-    activesupport (6.0.3.1)
+    activemodel (6.1.1)
+      activesupport (= 6.1.1)
+    activesupport (6.1.1)
       concurrent-ruby (~> 1.0, >= 1.0.2)
-      i18n (>= 0.7, < 2)
-      minitest (~> 5.1)
-      tzinfo (~> 1.1)
-      zeitwerk (~> 2.2, >= 2.2.2)
+      i18n (>= 1.6, < 2)
+      minitest (>= 5.1)
+      tzinfo (~> 2.0)
+      zeitwerk (~> 2.3)
     addressable (2.7.0)
       public_suffix (>= 2.0.2, < 5.0)
-    ast (2.4.0)
-    bundler-audit (0.6.1)
+    ast (2.4.2)
+    bundler-audit (0.7.0.1)
       bundler (>= 1.2.0, < 3)
-      thor (~> 0.18)
-    byebug (11.1.3)
-    concurrent-ruby (1.1.6)
-    crack (0.4.3)
-      safe_yaml (~> 1.0.0)
-    diff-lcs (1.3)
-    ffaker (2.15.0)
+      thor (>= 0.18, < 2)
+    concurrent-ruby (1.1.8)
+    crack (0.4.5)
+      rexml
+    diff-lcs (1.4.4)
+    ffaker (2.17.0)
     hashdiff (1.0.1)
-    i18n (1.8.2)
+    i18n (1.8.8)
       concurrent-ruby (~> 1.0)
-    jbuilder (2.10.0)
+    jbuilder (2.11.2)
       activesupport (>= 5.0.0)
-    minitest (5.14.1)
+    minitest (5.14.3)
     net-hippie (0.3.2)
-    parallel (1.19.1)
-    parser (2.7.1.2)
-      ast (~> 2.4.0)
+    parallel (1.20.1)
+    parser (3.0.0.0)
+      ast (~> 2.4.1)
     parslet (2.0.0)
-    public_suffix (4.0.5)
+    public_suffix (4.0.6)
     rainbow (3.0.0)
-    rake (13.0.1)
+    rake (13.0.3)
+    regexp_parser (2.0.3)
     rexml (3.2.4)
-    rspec (3.9.0)
-      rspec-core (~> 3.9.0)
-      rspec-expectations (~> 3.9.0)
-      rspec-mocks (~> 3.9.0)
-    rspec-core (3.9.2)
-      rspec-support (~> 3.9.3)
-    rspec-expectations (3.9.2)
+    rspec (3.10.0)
+      rspec-core (~> 3.10.0)
+      rspec-expectations (~> 3.10.0)
+      rspec-mocks (~> 3.10.0)
+    rspec-core (3.10.1)
+      rspec-support (~> 3.10.0)
+    rspec-expectations (3.10.1)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.9.0)
-    rspec-mocks (3.9.1)
+      rspec-support (~> 3.10.0)
+    rspec-mocks (3.10.2)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.9.0)
-    rspec-support (3.9.3)
-    rubocop (0.83.0)
+      rspec-support (~> 3.10.0)
+    rspec-support (3.10.2)
+    rubocop (0.93.1)
       parallel (~> 1.10)
-      parser (>= 2.7.0.1)
+      parser (>= 2.7.1.5)
       rainbow (>= 2.2.2, < 4.0)
+      regexp_parser (>= 1.8)
       rexml
+      rubocop-ast (>= 0.6.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 2.0)
-    rubocop-rspec (1.39.0)
-      rubocop (>= 0.68.1)
-    ruby-progressbar (1.10.1)
-    safe_yaml (1.0.5)
-    thor (0.20.3)
-    thread_safe (0.3.6)
+    rubocop-ast (1.4.1)
+      parser (>= 2.7.1.5)
+    rubocop-rspec (1.44.1)
+      rubocop (~> 0.87)
+      rubocop-ast (>= 0.7.1)
+    ruby-progressbar (1.11.0)
+    thor (1.1.0)
     tilt (2.0.10)
     tilt-jbuilder (0.7.1)
       jbuilder
       tilt (>= 1.3.0, < 3)
-    tzinfo (1.2.7)
-      thread_safe (~> 0.1)
+    tzinfo (2.0.4)
+      concurrent-ruby (~> 1.0)
     unicode-display_width (1.7.0)
-    webmock (3.8.3)
+    webmock (3.11.2)
       addressable (>= 2.3.6)
       crack (>= 0.3.2)
       hashdiff (>= 0.4.0, < 2.0.0)
-    zeitwerk (2.3.0)
+    zeitwerk (2.4.2)
 
 PLATFORMS
   ruby
@@ -91,7 +94,6 @@ PLATFORMS
 DEPENDENCIES
   bundler (~> 2.0)
   bundler-audit (~> 0.6)
-  byebug
   ffaker (~> 2.7)
   rake (~> 13.0)
   rspec (~> 3.0)
Rakefile
@@ -9,5 +9,4 @@ RSpec::Core::RakeTask.new(:spec)
 RuboCop::RakeTask.new(:rubocop)
 Bundler::Audit::Task.new
 
-task lint: [:rubocop, 'bundle:audit']
 task default: :spec
scim-kit.gemspec
@@ -30,14 +30,13 @@ Gem::Specification.new do |spec|
   spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
   spec.metadata['yard.run'] = 'yri'
 
-  spec.add_dependency 'activemodel', '>= 5.2.0'
+  spec.add_dependency 'activemodel', '~> 6.1'
   spec.add_dependency 'net-hippie', '~> 0.3'
-  spec.add_dependency 'parslet', '>= 1.8', '< 3.0'
+  spec.add_dependency 'parslet', '~> 2.0'
   spec.add_dependency 'tilt', '~> 2.0'
   spec.add_dependency 'tilt-jbuilder', '~> 0.7'
   spec.add_development_dependency 'bundler', '~> 2.0'
   spec.add_development_dependency 'bundler-audit', '~> 0.6'
-  spec.add_development_dependency 'byebug'
   spec.add_development_dependency 'ffaker', '~> 2.7'
   spec.add_development_dependency 'rake', '~> 13.0'
   spec.add_development_dependency 'rspec', '~> 3.0'