Skip to content

Commit

Permalink
chore: major upgrade, lint and gems
Browse files Browse the repository at this point in the history
  • Loading branch information
ngarbezza committed Sep 26, 2024
1 parent 77686b9 commit 152ce7d
Show file tree
Hide file tree
Showing 142 changed files with 309 additions and 79 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Ruby CI

on: [push, pull_request]
on: push

permissions:
contents: read

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -19,7 +18,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
bundler-cache: true
- name: Run linter
run: bundle exec rubocop
- name: Run tests
Expand Down
12 changes: 2 additions & 10 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Lint/RaiseException:
Lint/StructNewOverride:
Enabled: true

# revisit this once Ruby 3 is out
Style/FrozenStringLiteralComment:
# Preferimos que los nombres de archivos no queden tan acoplados al objeto que estan testeando
RSpec/SpecFilePathFormat:
Enabled: false

Style/AndOr:
Expand Down Expand Up @@ -207,14 +207,6 @@ Style/RedundantRegexpEscape:
Style/SlicingWithRange:
Enabled: true

RSpec/AggregateExamples:
Enabled: false # Rule is broken in 2.7, and rubocop 0.88
Include:
- 'spec/**/*.rb'

RSpec/FilePath:
Enabled: false

RSpec/DescribeMethod:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-01-03 18:43:36 UTC using RuboCop version 1.7.0.
# on 2024-09-26 10:14:23 UTC using RuboCop version 1.66.1.
# 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
Expand Down
2 changes: 2 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# frozen_string_literal: true

SimpleCov.start { add_filter '/spec/' } if ENV['COVERAGE']
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'coveralls', '~> 0.8', require: false
gem 'error_handling_protocol', '~> 0.0.1'
gem 'rake', '~> 13'
gem 'treetop', '~> 1.6'

group :test do
gem 'autotest-standalone', '~> 4.5'
gem 'rspec', '~> 3.13'
gem 'simplecov', '~> 0.16', require: false
gem 'simplecov', '~> 0.22', require: false
gem 'test-prof', '~> 1.4'
end

group :development do
gem 'rubocop', '~> 1.63', require: false
gem 'rubocop', '~> 1.66', require: false
gem 'rubocop-rake', '~> 0.6', require: false
gem 'rubocop-rspec', '~> 2.23', require: false
gem 'rubocop-rspec', '~> 3.0', require: false
end
74 changes: 26 additions & 48 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,95 +3,73 @@ GEM
specs:
ast (2.4.2)
autotest-standalone (4.5.11)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
diff-lcs (1.5.1)
docile (1.3.4)
docile (1.4.1)
error_handling_protocol (0.0.1)
json (2.7.2)
language_server-protocol (3.17.0.3)
parallel (1.24.0)
parser (3.3.0.5)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
polyglot (0.3.5)
racc (1.7.3)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.0)
rexml (3.3.6)
strscan
regexp_parser (2.9.2)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.0)
rubocop (1.63.1)
rspec-support (3.13.1)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-capybara (2.18.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.23.1)
rubocop (~> 1.33)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.23.2)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec (3.0.5)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
simplecov (0.16.1)
simplecov (0.22.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
strscan (3.1.0)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
test-prof (1.4.1)
thor (1.0.1)
tins (1.26.0)
sync
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
test-prof (1.4.2)
treetop (1.6.12)
polyglot (~> 0.3)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)

PLATFORMS
ruby

DEPENDENCIES
autotest-standalone (~> 4.5)
coveralls (~> 0.8)
error_handling_protocol (~> 0.0.1)
rake (~> 13)
rspec (~> 3.13)
rubocop (~> 1.63)
rubocop (~> 1.66)
rubocop-rake (~> 0.6)
rubocop-rspec (~> 2.23)
simplecov (~> 0.16)
rubocop-rspec (~> 3.0)
simplecov (~> 0.22)
test-prof (~> 1.4)
treetop (~> 1.6)

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## gobstones-rb

[![Build Status](https://travis-ci.org/ngarbezza/gobstones-rb.png?branch=master)](https://travis-ci.org/ngarbezza/gobstones-rb)
[![Coverage Status](https://coveralls.io/repos/ngarbezza/gobstones-rb/badge.png?branch=master)](https://coveralls.io/r/ngarbezza/gobstones-rb?branch=master)
[![Code Climate](https://codeclimate.com/github/ngarbezza/gobstones-rb.png)](https://codeclimate.com/github/ngarbezza/gobstones-rb)

Ruby implementation of the Gobstones programming language.
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec')

Expand Down
1 change: 1 addition & 0 deletions bin/gobstones
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib"

Expand Down
2 changes: 2 additions & 0 deletions gobstones.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

lib = File.expand_path 'lib', __dir__
$LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)

Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/cli/printer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/literals/color'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/cli/runner.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/parser/treetop_parser'
require 'gobstones/parser/parse_error'
require 'gobstones/cli/printer'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/extensions/all.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/extensions/boolean'
require 'gobstones/extensions/integer'
require 'gobstones/extensions/string'
2 changes: 2 additions & 0 deletions lib/gobstones/extensions/boolean.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/literals/boolean'

class TrueClass
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/extensions/integer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/literals/number'

class Integer
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/extensions/string.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/expressions/var_name'

class String
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/all.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/program'
require 'gobstones/lang/commands/all'
require 'gobstones/lang/definitions/all'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/all.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/commands/boom'
require 'gobstones/lang/commands/command_block'
require 'gobstones/lang/commands/if'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/boom.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/runner/errors/boom_error'
require 'gobstones/modules/equality_definition'

Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/command_block.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/conditional.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/if.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/commands/conditional'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/if_then_else.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/commands/if'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/ir_al_origen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/mover.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/expressions/one_arg_expression'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/multiple_assignment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/poner.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/expressions/one_arg_expression'
require 'gobstones/lang/commands/sacar'
require 'gobstones/runner/errors/gobstones_type_error'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/procedure_call.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/definitions/definition_call'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/repeat_with.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/commands/single_assignment'
require 'gobstones/lang/commands/command_block'
require 'gobstones/lang/commands/while'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/sacar.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/expressions/one_arg_expression'
require 'gobstones/lang/commands/poner'
require 'gobstones/runner/errors/gobstones_type_error'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/single_assignment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/skip.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/vaciar_tablero.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'

module Gobstones
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/commands/while.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/commands/conditional'
require 'gobstones/runner/errors/gobstones_runtime_error'

Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/definitions/all.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/lang/definitions/function'
require 'gobstones/lang/definitions/main'
require 'gobstones/lang/definitions/procedure'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/definitions/definition.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'
require 'gobstones/runner/errors/wrong_arguments_error'
require 'error_handling_protocol'
Expand Down
2 changes: 2 additions & 0 deletions lib/gobstones/lang/definitions/definition_call.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'gobstones/modules/equality_definition'
require 'gobstones/runner/errors/definition_not_found_error'

Expand Down
Loading

0 comments on commit 152ce7d

Please sign in to comment.