rails-tc 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +55 -0
- data/README.md +36 -20
- data/lib/rails/tc/tasks/tc.rake +5 -0
- data/lib/rails/tc/version.rb +1 -1
- metadata +2 -4
- data/.gitlab-ci.yml +0 -9
- data/.idea/workspace.xml +0 -87
- data/.rspec +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be9c4fc548db0968f0ffe1ac6bcada40ef09e640669f65cb3ee673a4974e50ed
|
4
|
+
data.tar.gz: afc4590e886932467d2ca26872fa505107fbc1021c7a93ca6e07bc5f0ee99ccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4616319701e78fab303235bce1d91136caf25344864ee35277b518cff45a695d903af344f08cf9e3f08d4296f2af0a6644e5a73652b1f851d1d72c8e3ba0679c
|
7
|
+
data.tar.gz: a49d1c748c196096e6a132e9f5705bfd3bbbcd691f37a9029a11fe9c2bbc953a592ecf41ec2a58e589110ee2dd7180c80c64fcb2a0109035fe1b0d0fb0d8b97e
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rails-tc (0.2.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.2)
|
10
|
+
diff-lcs (1.5.0)
|
11
|
+
parallel (1.21.0)
|
12
|
+
parser (3.0.3.2)
|
13
|
+
ast (~> 2.4.1)
|
14
|
+
rainbow (3.0.0)
|
15
|
+
rake (13.0.6)
|
16
|
+
regexp_parser (2.2.0)
|
17
|
+
rexml (3.2.5)
|
18
|
+
rspec (3.10.0)
|
19
|
+
rspec-core (~> 3.10.0)
|
20
|
+
rspec-expectations (~> 3.10.0)
|
21
|
+
rspec-mocks (~> 3.10.0)
|
22
|
+
rspec-core (3.10.1)
|
23
|
+
rspec-support (~> 3.10.0)
|
24
|
+
rspec-expectations (3.10.1)
|
25
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
+
rspec-support (~> 3.10.0)
|
27
|
+
rspec-mocks (3.10.2)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.10.0)
|
30
|
+
rspec-support (3.10.3)
|
31
|
+
rubocop (1.24.0)
|
32
|
+
parallel (~> 1.10)
|
33
|
+
parser (>= 3.0.0.0)
|
34
|
+
rainbow (>= 2.2.2, < 4.0)
|
35
|
+
regexp_parser (>= 1.8, < 3.0)
|
36
|
+
rexml
|
37
|
+
rubocop-ast (>= 1.15.0, < 2.0)
|
38
|
+
ruby-progressbar (~> 1.7)
|
39
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
40
|
+
rubocop-ast (1.15.0)
|
41
|
+
parser (>= 3.0.1.1)
|
42
|
+
ruby-progressbar (1.11.0)
|
43
|
+
unicode-display_width (2.1.0)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
x86_64-linux
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
rails-tc!
|
50
|
+
rake (~> 13.0)
|
51
|
+
rspec (~> 3.0)
|
52
|
+
rubocop (~> 1.7)
|
53
|
+
|
54
|
+
BUNDLED WITH
|
55
|
+
2.2.25
|
data/README.md
CHANGED
@@ -1,39 +1,55 @@
|
|
1
|
-
#
|
1
|
+
# rails-tc
|
2
2
|
|
3
|
-
|
3
|
+
This gem provides time checking for Rails projects using Stripe's sorbet and tapioca. It is meant to provide an easy and
|
4
|
+
automated way to set up time checking.
|
4
5
|
|
5
|
-
|
6
|
+
# Installing
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
8
|
+
Add the gem to your `Gemfile` by adding the line
|
10
9
|
|
11
10
|
```ruby
|
12
|
-
gem 'rails-tc'
|
11
|
+
gem 'rails-tc', group: :development
|
13
12
|
```
|
14
13
|
|
15
|
-
|
14
|
+
and run `bundle install`
|
16
15
|
|
17
|
-
|
16
|
+
**or** do both actions at once by running
|
18
17
|
|
19
|
-
|
18
|
+
```shell
|
19
|
+
bundle add rails-tc --group development
|
20
|
+
```
|
20
21
|
|
21
|
-
|
22
|
+
# Usage
|
22
23
|
|
23
|
-
##
|
24
|
+
## Setup typing for the project
|
25
|
+
Once installed, run the following command once:
|
24
26
|
|
25
|
-
|
27
|
+
```shell
|
28
|
+
rails tc:install
|
29
|
+
```
|
26
30
|
|
27
|
-
|
31
|
+
This will:
|
32
|
+
* Add `sorbet` and `tapioca` as development dependencies
|
33
|
+
* Add `sorbet-runtime` as runtime dependency
|
34
|
+
* Initialize and setup sorbet
|
35
|
+
* Generate types for the current project using tapioco
|
36
|
+
* Patch rubocop config to disable `Style/AccessorGrouping`
|
28
37
|
|
29
|
-
|
38
|
+
## Run the type checker
|
30
39
|
|
31
|
-
To
|
40
|
+
To check the project for type errors, run
|
41
|
+
|
42
|
+
```shell
|
43
|
+
rails tc:check
|
44
|
+
```
|
32
45
|
|
33
|
-
|
46
|
+
This will list all errors but excludes all errors from `*.rbi` files because there will be a lot of false positives and
|
47
|
+
from gems and known issues we cannot change anyway.
|
34
48
|
|
35
|
-
|
49
|
+
## Update rails-specific type information
|
36
50
|
|
37
|
-
|
51
|
+
To update type information for url helpers and models, run:
|
38
52
|
|
39
|
-
|
53
|
+
```shell
|
54
|
+
rails tc:generate
|
55
|
+
```
|
data/lib/rails/tc/tasks/tc.rake
CHANGED
@@ -12,6 +12,11 @@ namespace :tc do
|
|
12
12
|
Rails::Tc::Rubocop.patch_configuration
|
13
13
|
end
|
14
14
|
|
15
|
+
desc "Update rails-specific types"
|
16
|
+
task generate: :environment do
|
17
|
+
Rails::Tc::CommandRunner.generate
|
18
|
+
end
|
19
|
+
|
15
20
|
desc "Check types in the project"
|
16
21
|
task check: :environment do
|
17
22
|
checker = Rails::Tc::TypeChecker.new([], ["*/**/*.rbi"])
|
data/lib/rails/tc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-tc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oskar Kirmis
|
@@ -19,12 +19,10 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- ".gitignore"
|
22
|
-
- ".gitlab-ci.yml"
|
23
|
-
- ".idea/workspace.xml"
|
24
|
-
- ".rspec"
|
25
22
|
- ".rubocop.yml"
|
26
23
|
- CHANGELOG.md
|
27
24
|
- Gemfile
|
25
|
+
- Gemfile.lock
|
28
26
|
- LICENSE.txt
|
29
27
|
- README.md
|
30
28
|
- Rakefile
|
data/.gitlab-ci.yml
DELETED
data/.idea/workspace.xml
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ChangeListManager">
|
4
|
-
<list default="true" id="70f1023d-93df-464d-ae60-42cd1388a1e4" name="Changes" comment="">
|
5
|
-
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
6
|
-
<change afterPath="$PROJECT_DIR$/.gitlab-ci.yml" afterDir="false" />
|
7
|
-
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
8
|
-
<change afterPath="$PROJECT_DIR$/.rspec" afterDir="false" />
|
9
|
-
<change afterPath="$PROJECT_DIR$/.rubocop.yml" afterDir="false" />
|
10
|
-
<change afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
|
11
|
-
<change afterPath="$PROJECT_DIR$/Gemfile" afterDir="false" />
|
12
|
-
<change afterPath="$PROJECT_DIR$/LICENSE.txt" afterDir="false" />
|
13
|
-
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
14
|
-
<change afterPath="$PROJECT_DIR$/Rakefile" afterDir="false" />
|
15
|
-
<change afterPath="$PROJECT_DIR$/bin/console" afterDir="false" />
|
16
|
-
<change afterPath="$PROJECT_DIR$/bin/setup" afterDir="false" />
|
17
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc.rb" afterDir="false" />
|
18
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc/command_runner.rb" afterDir="false" />
|
19
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc/railtie.rb" afterDir="false" />
|
20
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc/rubocop.rb" afterDir="false" />
|
21
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc/tasks/tc.rake" afterDir="false" />
|
22
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc/type_checker.rb" afterDir="false" />
|
23
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc/type_checker_error.rb" afterDir="false" />
|
24
|
-
<change afterPath="$PROJECT_DIR$/lib/rails/tc/version.rb" afterDir="false" />
|
25
|
-
<change afterPath="$PROJECT_DIR$/rails-tc.gemspec" afterDir="false" />
|
26
|
-
<change afterPath="$PROJECT_DIR$/spec/rails/tc_spec.rb" afterDir="false" />
|
27
|
-
<change afterPath="$PROJECT_DIR$/spec/spec_helper.rb" afterDir="false" />
|
28
|
-
</list>
|
29
|
-
<option name="SHOW_DIALOG" value="false" />
|
30
|
-
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
31
|
-
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
32
|
-
<option name="LAST_RESOLUTION" value="IGNORE" />
|
33
|
-
</component>
|
34
|
-
<component name="FileTemplateManagerImpl">
|
35
|
-
<option name="RECENT_TEMPLATES">
|
36
|
-
<list>
|
37
|
-
<option value="Ruby File" />
|
38
|
-
</list>
|
39
|
-
</option>
|
40
|
-
</component>
|
41
|
-
<component name="Git.Settings">
|
42
|
-
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
43
|
-
</component>
|
44
|
-
<component name="GitSEFilterConfiguration">
|
45
|
-
<file-type-list>
|
46
|
-
<filtered-out-file-type name="LOCAL_BRANCH" />
|
47
|
-
<filtered-out-file-type name="REMOTE_BRANCH" />
|
48
|
-
<filtered-out-file-type name="TAG" />
|
49
|
-
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
|
50
|
-
</file-type-list>
|
51
|
-
</component>
|
52
|
-
<component name="MarkdownSettingsMigration">
|
53
|
-
<option name="stateVersion" value="1" />
|
54
|
-
</component>
|
55
|
-
<component name="ProjectId" id="22oxrhkAKjljfVppUYbrdhBm39d" />
|
56
|
-
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
57
|
-
<component name="ProjectViewState">
|
58
|
-
<option name="hideEmptyMiddlePackages" value="true" />
|
59
|
-
<option name="showLibraryContents" value="true" />
|
60
|
-
</component>
|
61
|
-
<component name="PropertiesComponent">
|
62
|
-
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
63
|
-
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
64
|
-
<property name="WebServerToolWindowFactoryState" value="false" />
|
65
|
-
<property name="last.edited.regexp" value=" * def (0.9)" />
|
66
|
-
<property name="last_opened_file_path" value="$PROJECT_DIR$/../fa-x" />
|
67
|
-
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
68
|
-
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
69
|
-
<property name="vue.rearranger.settings.migration" value="true" />
|
70
|
-
</component>
|
71
|
-
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
72
|
-
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
|
73
|
-
<component name="TaskManager">
|
74
|
-
<task active="true" id="Default" summary="Default task">
|
75
|
-
<changelist id="70f1023d-93df-464d-ae60-42cd1388a1e4" name="Changes" comment="" />
|
76
|
-
<created>1640517942267</created>
|
77
|
-
<option name="number" value="Default" />
|
78
|
-
<option name="presentableId" value="Default" />
|
79
|
-
<updated>1640517942267</updated>
|
80
|
-
<workItem from="1640517945803" duration="6297000" />
|
81
|
-
</task>
|
82
|
-
<servers />
|
83
|
-
</component>
|
84
|
-
<component name="TypeScriptGeneratedFilesManager">
|
85
|
-
<option name="version" value="3" />
|
86
|
-
</component>
|
87
|
-
</project>
|
data/.rspec
DELETED