Skip to content

Commit 50bb916

Browse files
Merge pull request #22 from joaoGabriel55/build/add-standard-linter
Build: Add Standard: The Standard Linter/Formatter Gem
2 parents 2bd6b2f + 77247de commit 50bb916

16 files changed

+150
-105
lines changed

Gemfile

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

33
gemspec

Gemfile.lock

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
specs:
9+
ast (2.4.2)
910
diff-lcs (1.5.1)
11+
json (2.7.2)
12+
language_server-protocol (3.17.0.3)
13+
lint_roller (1.1.0)
14+
parallel (1.25.1)
15+
parser (3.3.4.0)
16+
ast (~> 2.4.1)
17+
racc
18+
racc (1.8.0)
19+
rainbow (3.1.1)
1020
rake (13.2.1)
21+
regexp_parser (2.9.2)
22+
rexml (3.3.2)
23+
strscan
1124
rspec (3.13.0)
1225
rspec-core (~> 3.13.0)
1326
rspec-expectations (~> 3.13.0)
@@ -21,14 +34,47 @@ GEM
2134
diff-lcs (>= 1.2.0, < 2.0)
2235
rspec-support (~> 3.13.0)
2336
rspec-support (3.13.1)
37+
rubocop (1.64.1)
38+
json (~> 2.3)
39+
language_server-protocol (>= 3.17.0)
40+
parallel (~> 1.10)
41+
parser (>= 3.3.0.2)
42+
rainbow (>= 2.2.2, < 4.0)
43+
regexp_parser (>= 1.8, < 3.0)
44+
rexml (>= 3.2.5, < 4.0)
45+
rubocop-ast (>= 1.31.1, < 2.0)
46+
ruby-progressbar (~> 1.7)
47+
unicode-display_width (>= 2.4.0, < 3.0)
48+
rubocop-ast (1.31.3)
49+
parser (>= 3.3.1.0)
50+
rubocop-performance (1.21.1)
51+
rubocop (>= 1.48.1, < 2.0)
52+
rubocop-ast (>= 1.31.1, < 2.0)
53+
ruby-progressbar (1.13.0)
54+
standard (1.39.2)
55+
language_server-protocol (~> 3.17.0.2)
56+
lint_roller (~> 1.0)
57+
rubocop (~> 1.64.0)
58+
standard-custom (~> 1.0.0)
59+
standard-performance (~> 1.4)
60+
standard-custom (1.0.2)
61+
lint_roller (~> 1.0)
62+
rubocop (~> 1.50)
63+
standard-performance (1.4.0)
64+
lint_roller (~> 1.1)
65+
rubocop-performance (~> 1.21.0)
66+
strscan (3.1.0)
67+
unicode-display_width (2.5.0)
2468

2569
PLATFORMS
70+
arm64-darwin-23
2671
x86_64-linux
2772

2873
DEPENDENCIES
2974
rails_tracepoint_stack!
3075
rake (~> 13.0, >= 13.0.0)
3176
rspec (~> 3.0, >= 3.0.0)
77+
standard (~> 1.39, >= 1.39.1)
3278

3379
BUNDLED WITH
34-
2.4.17
80+
2.5.16

Rakefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
2-
require 'rake'
3-
require 'rspec/core/rake_task'
1+
require "rake"
2+
require "rspec/core/rake_task"
43

54
RSpec::Core::RakeTask.new(:spec)
65

lib/rails_tracepoint_stack.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def self.enable_trace
2828
end
2929
end
3030

31-
if ENV.fetch('RAILS_TRACEPOINT_STACK_ENABLED', 'false') == 'true'
31+
if ENV.fetch("RAILS_TRACEPOINT_STACK_ENABLED", "false") == "true"
3232
$rails_tracer_rtps = RailsTracepointStack::Tracer.new.tracer
3333
$rails_tracer_rtps.enable
3434

lib/rails_tracepoint_stack/filter/rb_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module RailsTracepointStack
22
module Filter
33
class RbConfig
44
def self.ruby_lib_path
5-
@ruby_lib_path ||= ::RbConfig::CONFIG['rubylibdir']
5+
@ruby_lib_path ||= ::RbConfig::CONFIG["rubylibdir"]
66
end
77
end
88
end

lib/rails_tracepoint_stack/logger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def self.log(msg)
55
RailsTracepointStack.configuration.logger.info(msg)
66
else
77
# TODO: Add the support to Rails.env for the default filename
8-
File.open("log/rails_tracepoint_stack.log", 'a') do |f|
8+
File.open("log/rails_tracepoint_stack.log", "a") do |f|
99
f.puts msg
1010
end
1111
end

lib/rails_tracepoint_stack/trace.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'forwardable'
1+
require "forwardable"
22

33
module RailsTracepointStack
44
class Trace

lib/rails_tracepoint_stack/trace_filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def ignore_trace?(trace:)
2222
end
2323
if should_ignore_because_is_ruby_trace?(trace: trace)
2424
return true
25-
end
25+
end
2626

2727
return false
2828
end

lib/rails_tracepoint_stack/tracer.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#TODO: Move to a loader file
2-
require 'rails_tracepoint_stack/logger'
3-
require 'rails_tracepoint_stack/trace_filter'
4-
require 'rails_tracepoint_stack/trace'
5-
require 'rails_tracepoint_stack/log_formatter'
1+
# TODO: Move to a loader file
2+
require "rails_tracepoint_stack/logger"
3+
require "rails_tracepoint_stack/trace_filter"
4+
require "rails_tracepoint_stack/trace"
5+
require "rails_tracepoint_stack/log_formatter"
66

77
module RailsTracepointStack
88
class Tracer
@@ -16,7 +16,7 @@ def tracer
1616

1717
# TODO: Use proper OO
1818
message = RailsTracepointStack::LogFormatter.message trace
19-
RailsTracepointStack::Logger.log message
19+
RailsTracepointStack::Logger.log message
2020
end
2121
end
2222
end

rails_tracepoint_stack.gemspec

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
require_relative "lib/rails_tracepoint_stack/version"
22

33
Gem::Specification.new do |s|
4-
s.name = "rails_tracepoint_stack"
5-
s.version = RailsTracepointStack::VERSION
6-
s.summary = "Get a complete stack trace for your code on a Rails application."
4+
s.name = "rails_tracepoint_stack"
5+
s.version = RailsTracepointStack::VERSION
6+
s.summary = "Get a complete stack trace for your code on a Rails application."
77
s.description = "A formatted output of all methods called in your rails application of code created by the developer, with the complete path to the class/module, including passed params."
8-
s.authors = ["Carlos Daniel Pohlod"]
9-
s.email = "[email protected]"
10-
s.files = [
8+
s.authors = ["Carlos Daniel Pohlod"]
9+
s.email = "[email protected]"
10+
s.files = [
1111
"lib/rails_tracepoint_stack.rb",
1212
"lib/rails_tracepoint_stack/configuration.rb",
1313
"lib/rails_tracepoint_stack/log_formatter.rb",
@@ -23,12 +23,13 @@ Gem::Specification.new do |s|
2323
"lib/rails_tracepoint_stack/filter/trace_from_ruby_code_filter.rb",
2424
"lib/rails_tracepoint_stack/filter/trace_to_ignore_filter.rb",
2525
]
26-
s.homepage = "https://github.com/carlosdanielpohlod/rails_tracepoint_stack/"
27-
s.license = "MIT"
26+
s.homepage = "https://github.com/carlosdanielpohlod/rails_tracepoint_stack/"
27+
s.license = "MIT"
2828
s.metadata["documentation_uri"] = "https://github.com/carlosdanielpohlod/rails_tracepoint_stack/"
2929
s.metadata["changelog_uri"] = "https://github.com/carlosdanielpohlod/rails_tracepoint_stack/blob/main/changelog.md"
3030

31-
s.required_ruby_version = '>= 3.0'
32-
s.add_development_dependency 'rspec', '~> 3.0', '>= 3.0.0'
33-
s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.0'
31+
s.required_ruby_version = ">= 3.0"
32+
s.add_development_dependency "rspec", "~> 3.0", ">= 3.0.0"
33+
s.add_development_dependency "rake", "~> 13.0", ">= 13.0.0"
34+
s.add_development_dependency "standard", "~> 1.39", ">= 1.39.1"
3435
end

0 commit comments

Comments
 (0)