turbo_test_static_analysis 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/tests.yml +42 -0
  3. data/.gitignore +66 -0
  4. data/.rubocop.yml +44 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +10 -0
  7. data/Gemfile.common +3 -0
  8. data/Gemfile.lock +54 -0
  9. data/GemfileCI +9 -0
  10. data/GemfileCI.lock +69 -0
  11. data/LICENSE.txt +21 -0
  12. data/Makefile +44 -0
  13. data/README.md +27 -0
  14. data/Rakefile +19 -0
  15. data/bin/console +14 -0
  16. data/bin/setup +8 -0
  17. data/lib/turbo_test_static_analysis.rb +6 -0
  18. data/lib/turbo_test_static_analysis/active_record_schema.rb +28 -0
  19. data/lib/turbo_test_static_analysis/active_record_schema/constructor.rb +51 -0
  20. data/lib/turbo_test_static_analysis/active_record_schema/diff.rb +16 -0
  21. data/lib/turbo_test_static_analysis/active_record_schema/diff_compute.rb +52 -0
  22. data/lib/turbo_test_static_analysis/active_record_schema/map.rb +15 -0
  23. data/lib/turbo_test_static_analysis/active_record_schema/sexp_builder/line_column_stack.rb +41 -0
  24. data/lib/turbo_test_static_analysis/active_record_schema/sexp_builder/line_stack_sexp_builder.rb +40 -0
  25. data/lib/turbo_test_static_analysis/active_record_schema/sexp_builder/sexp_builder.rb +129 -0
  26. data/lib/turbo_test_static_analysis/active_record_schema/snapshot.rb +15 -0
  27. data/lib/turbo_test_static_analysis/constants.rb +13 -0
  28. data/lib/turbo_test_static_analysis/constants/node.rb +66 -0
  29. data/lib/turbo_test_static_analysis/constants/node_maker.rb +118 -0
  30. data/lib/turbo_test_static_analysis/constants/node_processor.rb +115 -0
  31. data/lib/turbo_test_static_analysis/constants/sexp_builder.rb +109 -0
  32. data/lib/turbo_test_static_analysis/constants/token_matcher.rb +43 -0
  33. data/lib/turbo_test_static_analysis/version.rb +7 -0
  34. data/turbo_test_static_analysis.gemspec +30 -0
  35. metadata +120 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bb8f77e682c83d4ade5e8008f8048ec9f1959ec4f94d12f310d679b69de54789
4
+ data.tar.gz: b7bb8767040cb75ffed30296fe8e6ecd457fb7503eb5230b28f2ff4ec809c33d
5
+ SHA512:
6
+ metadata.gz: e31573496a058a28decd54850a346b9034dfca65fe42b51a3a199ad05044daa022204ddfd1fa37f5ac291e429070dcbf3423caa75d34420d9b7b656485ef2308
7
+ data.tar.gz: ff669b57adecf03cd121decd88dbce795762676be256c0c644826cd94d547ba2f3fec770da4d178e6b756eb22c859c67f4188212d169b15a081f851ee3873adf
@@ -0,0 +1,42 @@
1
+ name: Tests
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ test:
7
+ name: >-
8
+ Ruby: ${{ matrix.ruby }}
9
+
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ ruby: [ '2.4', '2.5', '2.6', '2.7' ]
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+
23
+ - name: Install dependencies
24
+ env:
25
+ BUNDLE_GEMFILE: GemfileCI
26
+ run: |
27
+ bundle config path vendor/bundle
28
+ bundle install --binstubs --jobs 4 --retry 3
29
+
30
+ - name: Run tests
31
+ env:
32
+ BUNDLE_GEMFILE: GemfileCI
33
+ run: |
34
+ bundle exec rake
35
+
36
+ - name: Coveralls
37
+ if: ${{ matrix.ruby == '2.7' }}
38
+ env:
39
+ BUNDLE_GEMFILE: GemfileCI
40
+ COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
41
+ run: |
42
+ bundle exec rake coveralls:push
@@ -0,0 +1,66 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ *.gem
11
+ *.rbc
12
+ /.config
13
+ /coverage/
14
+ /InstalledFiles
15
+ /pkg/
16
+ /spec/reports/
17
+ /spec/examples.txt
18
+ /test/tmp/
19
+ /test/version_tmp/
20
+ /tmp/
21
+
22
+ # Used by dotenv library to load environment variables.
23
+ # .env
24
+
25
+ ## Specific to RubyMotion:
26
+ .dat*
27
+ .repl_history
28
+ build/
29
+ *.bridgesupport
30
+ build-iPhoneOS/
31
+ build-iPhoneSimulator/
32
+
33
+ .DS_Store
34
+
35
+ ## Specific to RubyMotion (use of CocoaPods):
36
+ #
37
+ # We recommend against adding the Pods directory to your .gitignore. However
38
+ # you should judge for yourself, the pros and cons are mentioned at:
39
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
40
+ #
41
+ # vendor/Pods/
42
+
43
+ ## Documentation cache and generated files:
44
+ /.yardoc/
45
+ /_yardoc/
46
+ /doc/
47
+ /rdoc/
48
+
49
+ ## Environment normalization:
50
+ /.bundle/
51
+ /vendor/bundle
52
+ /lib/bundler/man/
53
+
54
+ # for a library or gem, you might want to ignore these files since the code is
55
+ # intended to run in multiple environments; otherwise, check them in:
56
+ # Gemfile.lock
57
+ # .ruby-version
58
+ # .ruby-gemset
59
+
60
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
61
+ .rvmrc
62
+
63
+ #SAM artifacts
64
+ /packaged.yaml
65
+
66
+ .byebug_history
@@ -0,0 +1,44 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ DisplayStyleGuide: true
4
+ ExtraDetails: true
5
+ NewCops: enable
6
+ TargetRubyVersion: 2.7
7
+ Exclude:
8
+ - Gemfile
9
+ - "**/*.gemfile"
10
+ - bin/*
11
+ - "*.gemspec"
12
+ - test/support/files/schemas/*.rb
13
+
14
+ Layout/LineLength:
15
+ Enabled: true
16
+ AutoCorrect: false
17
+ Max: 100
18
+
19
+ Metrics/BlockLength:
20
+ Exclude:
21
+ - test/**/*_test.rb
22
+
23
+ Metrics/ClassLength:
24
+ Exclude:
25
+ - test/**/*
26
+ - lib/tasks/*
27
+
28
+ Metrics/MethodLength:
29
+ Max: 10
30
+ Exclude:
31
+ - test/**/*
32
+
33
+ Style/ClassAndModuleChildren:
34
+ Exclude:
35
+ - test/**/*
36
+
37
+ Style/Documentation:
38
+ Enabled: false
39
+
40
+ Style/StringLiterals:
41
+ Enabled: true
42
+ EnforcedStyle: double_quotes
43
+ ConsistentQuotesInMultiline: true
44
+
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at marcessindi@icloud.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in turbo_test_static_analysis.gemspec
6
+ gemspec
7
+
8
+ eval_gemfile(File.expand_path('Gemfile.common', __dir__))
9
+
10
+ gem 'simplecov', '~> 0.18.5'
@@ -0,0 +1,3 @@
1
+ gem "rubocop"
2
+ gem "byebug"
3
+ gem "mocha"
@@ -0,0 +1,54 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ turbo_test_static_analysis (0.1.0)
5
+ sorcerer
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.1)
11
+ byebug (11.1.3)
12
+ docile (1.3.2)
13
+ minitest (5.14.1)
14
+ mocha (1.11.2)
15
+ parallel (1.19.2)
16
+ parser (2.7.1.4)
17
+ ast (~> 2.4.1)
18
+ rainbow (3.0.0)
19
+ rake (13.0.1)
20
+ regexp_parser (1.7.1)
21
+ rexml (3.2.4)
22
+ rubocop (0.89.0)
23
+ parallel (~> 1.10)
24
+ parser (>= 2.7.1.1)
25
+ rainbow (>= 2.2.2, < 4.0)
26
+ regexp_parser (>= 1.7)
27
+ rexml
28
+ rubocop-ast (>= 0.1.0, < 1.0)
29
+ ruby-progressbar (~> 1.7)
30
+ unicode-display_width (>= 1.4.0, < 2.0)
31
+ rubocop-ast (0.3.0)
32
+ parser (>= 2.7.1.4)
33
+ ruby-progressbar (1.10.1)
34
+ simplecov (0.18.5)
35
+ docile (~> 1.1)
36
+ simplecov-html (~> 0.11)
37
+ simplecov-html (0.12.2)
38
+ sorcerer (2.0.1)
39
+ unicode-display_width (1.7.0)
40
+
41
+ PLATFORMS
42
+ ruby
43
+
44
+ DEPENDENCIES
45
+ byebug
46
+ minitest (~> 5.14.1)
47
+ mocha
48
+ rake (~> 13.0)
49
+ rubocop
50
+ simplecov (~> 0.18.5)
51
+ turbo_test_static_analysis!
52
+
53
+ BUNDLED WITH
54
+ 2.1.4
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in turbo_test_ruby_refinements.gemspec
4
+ gemspec
5
+
6
+ eval_gemfile(File.expand_path("Gemfile.common", __dir__))
7
+
8
+ gem "simplecov", "~> 0.16.1"
9
+ gem "coveralls"
@@ -0,0 +1,69 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ turbo_test_static_analysis (0.1.0)
5
+ sorcerer
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.1)
11
+ byebug (11.1.3)
12
+ coveralls (0.8.23)
13
+ json (>= 1.8, < 3)
14
+ simplecov (~> 0.16.1)
15
+ term-ansicolor (~> 1.3)
16
+ thor (>= 0.19.4, < 2.0)
17
+ tins (~> 1.6)
18
+ docile (1.3.2)
19
+ json (2.3.1)
20
+ minitest (5.14.1)
21
+ mocha (1.11.2)
22
+ parallel (1.19.2)
23
+ parser (2.7.1.4)
24
+ ast (~> 2.4.1)
25
+ rainbow (3.0.0)
26
+ rake (13.0.1)
27
+ regexp_parser (1.7.1)
28
+ rexml (3.2.4)
29
+ rubocop (0.89.0)
30
+ parallel (~> 1.10)
31
+ parser (>= 2.7.1.1)
32
+ rainbow (>= 2.2.2, < 4.0)
33
+ regexp_parser (>= 1.7)
34
+ rexml
35
+ rubocop-ast (>= 0.1.0, < 1.0)
36
+ ruby-progressbar (~> 1.7)
37
+ unicode-display_width (>= 1.4.0, < 2.0)
38
+ rubocop-ast (0.3.0)
39
+ parser (>= 2.7.1.4)
40
+ ruby-progressbar (1.10.1)
41
+ simplecov (0.16.1)
42
+ docile (~> 1.1)
43
+ json (>= 1.8, < 3)
44
+ simplecov-html (~> 0.10.0)
45
+ simplecov-html (0.10.2)
46
+ sorcerer (2.0.1)
47
+ sync (0.5.0)
48
+ term-ansicolor (1.7.1)
49
+ tins (~> 1.0)
50
+ thor (1.0.1)
51
+ tins (1.25.0)
52
+ sync
53
+ unicode-display_width (1.7.0)
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ byebug
60
+ coveralls
61
+ minitest (~> 5.14.1)
62
+ mocha
63
+ rake (~> 13.0)
64
+ rubocop
65
+ simplecov (~> 0.16.1)
66
+ turbo_test_static_analysis!
67
+
68
+ BUNDLED WITH
69
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Marcos Essindi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,44 @@
1
+ # Adapted from https://github.com/zspencer/make-many-rubies/blob/master/Makefile
2
+
3
+ # Allows running (and re-running) of tests against several ruby versions,
4
+ # assuming you use rbenv instead of rvm.
5
+
6
+ # Uses pattern rules (task-$:) and automatic variables ($*).
7
+ # Pattern rules: http://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_10.html#SEC98
8
+ # Automatic variables: http://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_10.html#SEC101
9
+
10
+ # Rbenv-friendly version identifiers for supported Rubys
11
+ 24_version = 2.4.10
12
+ 25_version = 2.5.8
13
+ 26_version = 2.6.6
14
+ 27_version = 2.7.1
15
+
16
+ # The ruby version for use in a given rule.
17
+ # Requires a matched pattern rule and a supported ruby version.
18
+ #
19
+ # Given a pattern rule defined as "install-ruby-%"
20
+ # When the rule is ran as "install-ruby-193"
21
+ # Then the inner addsuffix call evaluates to "193_version"
22
+ # And given_ruby_version becomes "1.9.3-p551"
23
+ given_ruby_version = $($(addsuffix _version, $*))
24
+
25
+ # Instruct rbenv on which Ruby version to use when running a command.
26
+ # Requires a pattern rule and a supported ruby version.
27
+ #
28
+ # Given a pattern rule defined as "test-%"
29
+ # When the rule is ran as "test-187"
30
+ # Then with_given_ruby becomes "RBENV_VERSION=1.8.7-p375"
31
+ with_given_ruby = RBENV_VERSION=$(given_ruby_version)
32
+
33
+
34
+ # Runs tests for all supported ruby versions.
35
+ test: test-24 test-25 test-26 test-27
36
+ test_24: test-24
37
+ test_25: test-25
38
+ test_26: test-26
39
+ test_27: test-27
40
+
41
+ # Runs tests against a specific ruby version
42
+ test-%:
43
+ $(with_given_ruby) bundle install
44
+ $(with_given_ruby) bundle exec rake