Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 6 additions & 13 deletions .github/workflows/super_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install Ruby dependencies
run: bundle install
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -38,8 +40,10 @@ jobs:
- name: Install Yarn dependencies
run: yarn --immutable
- name: Lint
run: yarn lint
- name: Audit
run: bundle exec rubocop --parallel
- name: Audit Ruby
run: bundle exec bundle-audit check --update
- name: Audit JS
run: yarn audit

test:
Expand Down Expand Up @@ -70,17 +74,6 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install Zeus
run: gem install zeus
- name: Start Zeus
uses: JarvusInnovations/background-action@v1
with:
run: zeus start
wait-on: |
socket:.zeus.sock
file:.zeus.sock
wait-for: 15s
log-output-if: failure
- name: Run tests
run: bundle exec rake --trace

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.DS_Store
Gemfile.lock
gemfiles/.bundle
gemfiles/*.gemfile.lock
node_modules
Expand Down
3 changes: 2 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ if echo "$stdin" | grep -q "^(delete)"; then
exit 0
fi

scripts/lint-changed-files.sh --check
scripts/lint-changed-files.sh

echo
echo "*** Auditing dependencies ***************"
echo

yarn audit || exit $?
bundle exec bundle-audit || exit $?

echo
8 changes: 0 additions & 8 deletions .prettierignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc.json

This file was deleted.

41 changes: 41 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude

# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
# any parameters. The file can be placed either in your home
# directory or in some project directory.
#
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
#
# See https://docs.rubocop.org/rubocop/configuration
AllCops:
NewCops: enable
SuggestExtensions:
rubocop-rake: false
Exclude:
- 'gemfiles/**' # these are auto-generated by Appraisal
- 'tmp/**'
- 'vendor/**'
- vendor/**/*.rb
- gemfiles/vendor/bundle/**/*

Layout/LineLength:
Exclude:
- 'spec/**/*'

Lint/SuppressedException:
Exclude:
- 'spec/spec_helper.rb'
- 'support/test_plan.rb'

Naming/FileName:
Exclude:
- 'lib/super_diff/rspec-rails.rb'

Naming/VariableNumber:
Enabled: false
108 changes: 108 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude`
# on 2024-10-19 10:08:34 UTC using RuboCop version 1.67.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 31
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 112
Exclude:
- 'lib/super_diff/basic/operation_tree_builders/hash.rb'

# Offense count: 993
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 5536

# Offense count: 2
# Configuration parameters: CountBlocks, CountModifierForms, Max.
Metrics/BlockNesting:
Exclude:
- 'lib/super_diff/basic/operation_tree_builders/hash.rb'

# Offense count: 13
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
- 'lib/super_diff/basic/diff_formatters/collection.rb'
- 'lib/super_diff/basic/operation_tree_builders/hash.rb'
- 'lib/super_diff/basic/operation_tree_flatteners/collection.rb'
- 'lib/super_diff/core/configuration.rb'
- 'lib/super_diff/core/inspection_tree.rb'
- 'lib/super_diff/core/tiered_lines_elider.rb'
- 'lib/super_diff/csi/document.rb'
- 'lib/super_diff/csi/eight_bit_color.rb'
- 'lib/super_diff/csi/four_bit_color.rb'
- 'lib/super_diff/rspec/matcher_text_builders/base.rb'
- 'spec/support/command_runner.rb'
- 'spec/support/integration/test_programs/base.rb'
- 'support/test_plan.rb'

# Offense count: 3
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/CyclomaticComplexity:
Exclude:
- 'lib/super_diff/basic/operation_tree_builders/hash.rb'
- 'lib/super_diff/core/abstract_operation_tree_builder.rb'
- 'lib/super_diff/csi/document.rb'

# Offense count: 89
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 114

# Offense count: 1
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ModuleLength:
Exclude:
- 'lib/super_diff.rb'

# Offense count: 3
# Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
Metrics/ParameterLists:
Exclude:
- 'lib/super_diff/csi/eight_bit_color.rb'
- 'spec/support/integration/helpers.rb'
- 'spec/support/models/player.rb'

# Offense count: 4
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/PerceivedComplexity:
Exclude:
- 'lib/super_diff/basic/operation_tree_builders/hash.rb'
- 'lib/super_diff/core/abstract_operation_tree_builder.rb'
- 'lib/super_diff/core/tiered_lines_elider.rb'
- 'lib/super_diff/csi/document.rb'

# Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS

# Offense count: 207
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: format, sprintf, percent
Style/FormatString:
Exclude:
- 'lib/super_diff/core/helpers.rb'
- 'spec/unit/core/helpers_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, Autocorrect.
# SupportedStyles: module_function, extend_self, forbidden
Style/ModuleFunction:
Exclude:
- 'lib/super_diff/core/helpers.rb'
- 'spec/support/unit/helpers.rb'
42 changes: 21 additions & 21 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
# frozen_string_literal: true

rails_dependencies =
proc do
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "net-ftp"
gem "combustion"
gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
gem 'jdbc-sqlite3', platform: :jruby
gem 'net-ftp'
gem 'combustion'
end

appraisals = {
rails_6_0:
proc do
instance_eval(&rails_dependencies)

gem "rails", "~> 6.0.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
gem 'rails', '~> 6.0.0'
gem 'sqlite3', '~> 1.4.0', platform: %i[ruby mswin mingw]
end,
rails_6_1:
proc do
instance_eval(&rails_dependencies)

gem "rails", "~> 6.1.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
gem 'rails', '~> 6.1.0'
gem 'sqlite3', '~> 1.4.0', platform: %i[ruby mswin mingw]
end,
rails_7_0:
proc do
instance_eval(&rails_dependencies)

gem "rails", "~> 7.0.0"
gem "sqlite3", "~> 1.4.0", platform: %i[ruby mswin mingw]
gem 'rails', '~> 7.0.0'
gem 'sqlite3', '~> 1.4.0', platform: %i[ruby mswin mingw]
end,
no_rails: proc {},
rspec_lt_3_10:
proc do |with_rails|
version = "~> 3.9.0"
version = '~> 3.9.0'

gem "rspec", version
gem 'rspec', version

gem "rspec-rails" if with_rails
gem 'rspec-rails' if with_rails
end,
rspec_gte_3_10:
proc do |with_rails|
version = [">= 3.10", "< 4"]

# gem "rspec", *version

gem "rspec", "3.12.0"
gem "rspec-core", "3.12.0"
gem "rspec-expectations", "3.12.3"
gem "rspec-mocks", "3.12.0"
gem "rspec-support", "3.12.0"
gem 'rspec', '3.12.0'
gem 'rspec-core', '3.12.0'
gem 'rspec-expectations', '3.12.3'
gem 'rspec-mocks', '3.12.0'
gem 'rspec-support', '3.12.0'

gem "rspec-rails" if with_rails
gem 'rspec-rails' if with_rails
end
}

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- Fix multiline string diff with blank lines. [#266](https://github.com/splitwise/super_diff/pull/263)
- Improve inspection of Range objects. [#267](https://github.com/splitwise/super_diff/pull/267)

### Other changes

- Switch from Prettier to Rubocop. [#269](https://github.com/splitwise/super_diff/pull/269)

## 0.13.0 - 2024-09-22

### Features
Expand Down
27 changes: 14 additions & 13 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# frozen_string_literal: true

source "https://rubygems.org"
source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem "appraisal", github: "thoughtbot/appraisal"
gem "bundler-audit"
gem "childprocess"
gem "climate_control"
gem "pry-byebug", platform: :mri
gem "pry-nav", platform: :jruby
gem "rake"
gem "prettier_print"
gem "syntax_tree"
gem "syntax_tree-haml"
gem "syntax_tree-rbs"
gem "warnings_logger"
gem 'appraisal', github: 'thoughtbot/appraisal'
gem 'bundler-audit'
gem 'childprocess'
gem 'climate_control'
gem 'prettier_print'
gem 'pry-byebug', platform: :mri
gem 'pry-nav', platform: :jruby
gem 'rake'
gem 'rubocop'
gem 'syntax_tree'
gem 'syntax_tree-haml'
gem 'syntax_tree-rbs'
gem 'warnings_logger'

gemspec
Loading