Skip to content

Commit ca3002d

Browse files
committed
Add syntax_tree and config
1 parent 73f1df2 commit ca3002d

File tree

4 files changed

+41
-26
lines changed

4 files changed

+41
-26
lines changed

.streerc

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--print-width=120
2+
3+
# Append * to .rb files so my conform.nvim config works plz :-)
4+
#
5+
# syntax_tree = {
6+
# tmpfile_format = "$FILENAME.conform.tmp",
7+
# args = { "write", "$RELATIVE_FILEPATH" },
8+
# }
9+
#
10+
--ignore-files=build/*
11+
--ignore-files=ext/*
12+
--ignore-files=lib/abbrev.rb*
13+
--ignore-files=lib/benchmark.rb*
14+
--ignore-files=lib/cgi*
15+
--ignore-files=lib/delegate.rb*
16+
--ignore-files=lib/erb*
17+
--ignore-files=lib/find.rb*
18+
--ignore-files=lib/ipaddr.rb*
19+
--ignore-files=lib/matrix*
20+
--ignore-files=lib/natalie/compiler/binding_gen.rb*
21+
--ignore-files=lib/pp.rb*
22+
--ignore-files=lib/prettyprint.rb*
23+
--ignore-files=lib/random/formatter.rb*
24+
--ignore-files=lib/shellwords.rb*
25+
--ignore-files=lib/uri*
26+
--ignore-files=spec/*
27+
--ignore-files=test/support/version.rb*
28+
29+
--plugins=plugin/trailing_comma,plugin/single_quotes,plugin/disable_auto_ternary

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gem 'rake'
66

77
group :development do
88
gem 'stackprof'
9+
gem 'syntax_tree'
910
end
1011

1112
group :run_all_specs, optional: true do

Gemfile.lock

+4-26
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,20 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
ansi (1.5.0)
5-
ast (2.4.2)
65
builder (3.3.0)
76
concurrent-ruby (1.2.2)
8-
json (2.9.1)
9-
language_server-protocol (3.17.0.3)
107
minitest (5.25.4)
118
minitest-reporters (1.7.1)
129
ansi
1310
builder
1411
minitest (>= 5.0)
1512
ruby-progressbar
16-
parallel (1.26.3)
17-
parser (3.3.6.0)
18-
ast (~> 2.4.1)
19-
racc
20-
racc (1.8.1)
21-
rainbow (3.1.1)
13+
prettier_print (1.2.1)
2214
rake (13.1.0)
23-
regexp_parser (2.9.3)
24-
rubocop (1.69.2)
25-
json (~> 2.3)
26-
language_server-protocol (>= 3.17.0)
27-
parallel (~> 1.10)
28-
parser (>= 3.3.0.2)
29-
rainbow (>= 2.2.2, < 4.0)
30-
regexp_parser (>= 2.9.3, < 3.0)
31-
rubocop-ast (>= 1.36.2, < 2.0)
32-
ruby-progressbar (~> 1.7)
33-
unicode-display_width (>= 2.4.0, < 4.0)
34-
rubocop-ast (1.37.0)
35-
parser (>= 3.3.1.0)
3615
ruby-progressbar (1.13.0)
3716
stackprof (0.2.25)
38-
unicode-display_width (3.1.2)
39-
unicode-emoji (~> 4.0, >= 4.0.4)
40-
unicode-emoji (4.0.4)
17+
syntax_tree (6.2.0)
18+
prettier_print (>= 1.2.0)
4119

4220
PLATFORMS
4321
arm64-darwin-20
@@ -56,8 +34,8 @@ DEPENDENCIES
5634
minitest
5735
minitest-reporters
5836
rake
59-
rubocop
6037
stackprof
38+
syntax_tree
6139

6240
BUNDLED WITH
6341
2.3.26

Rakefile

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require_relative './lib/natalie/compiler/flags'
2+
require 'syntax_tree/rake_tasks'
23

34
task default: :build
45

@@ -694,3 +695,9 @@ def current_build_mode
694695

695696
File.read('.build').strip
696697
end
698+
699+
SyntaxTree::Rake::CheckTask.new
700+
SyntaxTree::Rake::WriteTask.new do |t|
701+
t.source_files = FileList[%w[Gemfile Rakefile lib/**/*.rb test/**/*.rb]]
702+
# additional options in .streerc are respected
703+
end

0 commit comments

Comments
 (0)