unparser 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. metadata +3 -59
  4. data/.github/workflows/ci.yml +0 -90
  5. data/.gitignore +0 -37
  6. data/.rspec +0 -4
  7. data/.rubocop.yml +0 -126
  8. data/Changelog.md +0 -162
  9. data/Gemfile +0 -9
  10. data/Gemfile.lock +0 -111
  11. data/LICENSE +0 -20
  12. data/Rakefile +0 -22
  13. data/config/devtools.yml +0 -2
  14. data/config/flay.yml +0 -3
  15. data/config/flog.yml +0 -2
  16. data/config/mutant.yml +0 -6
  17. data/config/reek.yml +0 -98
  18. data/config/yardstick.yml +0 -2
  19. data/spec/integration/unparser/corpus_spec.rb +0 -125
  20. data/spec/integrations.yml +0 -92
  21. data/spec/spec_helper.rb +0 -42
  22. data/spec/unit/unparser/buffer/append_spec.rb +0 -24
  23. data/spec/unit/unparser/buffer/append_without_prefix_spec.rb +0 -23
  24. data/spec/unit/unparser/buffer/capture_content_spec.rb +0 -17
  25. data/spec/unit/unparser/buffer/content_spec.rb +0 -38
  26. data/spec/unit/unparser/buffer/fresh_line_spec.rb +0 -20
  27. data/spec/unit/unparser/buffer/indent_spec.rb +0 -20
  28. data/spec/unit/unparser/buffer/nl_spec.rb +0 -16
  29. data/spec/unit/unparser/buffer/unindent_spec.rb +0 -20
  30. data/spec/unit/unparser/color_spec.rb +0 -40
  31. data/spec/unit/unparser/comments/consume_spec.rb +0 -22
  32. data/spec/unit/unparser/comments/take_all_spec.rb +0 -19
  33. data/spec/unit/unparser/comments/take_before_spec.rb +0 -46
  34. data/spec/unit/unparser/comments/take_eol_comments_spec.rb +0 -32
  35. data/spec/unit/unparser/diff_spec.rb +0 -189
  36. data/spec/unit/unparser/emitter/class_methods/handle_spec.rb +0 -17
  37. data/spec/unit/unparser/validation_spec.rb +0 -327
  38. data/spec/unit/unparser_spec.rb +0 -1920
  39. data/unparser.gemspec +0 -35
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
6
-
7
- source 'https://oss:Px2ENN7S91OmWaD5G7MIQJi1dmtmYrEh@gem.mutant.dev' do
8
- gem 'mutant-license'
9
- end
@@ -1,111 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- unparser (0.4.7)
5
- abstract_type (~> 0.0.7)
6
- adamantium (~> 0.2.0)
7
- anima (~> 0.3.1)
8
- concord (~> 0.1.5)
9
- diff-lcs (~> 1.3)
10
- equalizer (~> 0.0.9)
11
- mprelude (~> 0.1.0)
12
- parser (>= 2.6.5)
13
- procto (~> 0.0.2)
14
-
15
- GEM
16
- remote: https://rubygems.org/
17
- remote: https://oss:Px2ENN7S91OmWaD5G7MIQJi1dmtmYrEh@gem.mutant.dev/
18
- specs:
19
- abstract_type (0.0.7)
20
- adamantium (0.2.0)
21
- ice_nine (~> 0.11.0)
22
- memoizable (~> 0.4.0)
23
- anima (0.3.1)
24
- abstract_type (~> 0.0.7)
25
- adamantium (~> 0.2)
26
- equalizer (~> 0.0.11)
27
- ast (2.4.1)
28
- concord (0.1.5)
29
- adamantium (~> 0.2.0)
30
- equalizer (~> 0.0.9)
31
- diff-lcs (1.3)
32
- equalizer (0.0.11)
33
- ice_nine (0.11.2)
34
- jaro_winkler (1.5.4)
35
- memoizable (0.4.2)
36
- thread_safe (~> 0.3, >= 0.3.1)
37
- mprelude (0.1.0)
38
- abstract_type (~> 0.0.7)
39
- adamantium (~> 0.2.0)
40
- concord (~> 0.1.5)
41
- equalizer (~> 0.0.9)
42
- ice_nine (~> 0.11.1)
43
- procto (~> 0.0.2)
44
- mutant (0.9.9)
45
- abstract_type (~> 0.0.7)
46
- adamantium (~> 0.2.0)
47
- anima (~> 0.3.1)
48
- ast (~> 2.2)
49
- concord (~> 0.1.5)
50
- diff-lcs (= 1.3)
51
- equalizer (~> 0.0.9)
52
- ice_nine (~> 0.11.1)
53
- memoizable (~> 0.4.2)
54
- mprelude (~> 0.1.0)
55
- parser (~> 2.7.1)
56
- procto (~> 0.0.2)
57
- unparser (~> 0.4.6)
58
- variable (~> 0.0.1)
59
- mutant-license (0.1.0)
60
- mutant-rspec (0.9.9)
61
- mutant (~> 0.9.9)
62
- rspec-core (>= 3.8.0, < 4.0.0)
63
- parallel (1.19.2)
64
- parser (2.7.1.4)
65
- ast (~> 2.4.1)
66
- procto (0.0.3)
67
- rainbow (3.0.0)
68
- rspec (3.9.0)
69
- rspec-core (~> 3.9.0)
70
- rspec-expectations (~> 3.9.0)
71
- rspec-mocks (~> 3.9.0)
72
- rspec-core (3.9.2)
73
- rspec-support (~> 3.9.3)
74
- rspec-expectations (3.9.2)
75
- diff-lcs (>= 1.2.0, < 2.0)
76
- rspec-support (~> 3.9.0)
77
- rspec-its (1.2.0)
78
- rspec-core (>= 3.0.0)
79
- rspec-expectations (>= 3.0.0)
80
- rspec-mocks (3.9.1)
81
- diff-lcs (>= 1.2.0, < 2.0)
82
- rspec-support (~> 3.9.0)
83
- rspec-support (3.9.3)
84
- rubocop (0.79.0)
85
- jaro_winkler (~> 1.5.1)
86
- parallel (~> 1.10)
87
- parser (>= 2.7.0.1)
88
- rainbow (>= 2.2.2, < 4.0)
89
- ruby-progressbar (~> 1.7)
90
- unicode-display_width (>= 1.4.0, < 1.7)
91
- ruby-progressbar (1.10.1)
92
- thread_safe (0.3.6)
93
- unicode-display_width (1.6.1)
94
- variable (0.0.1)
95
- equalizer (~> 0.0.11)
96
-
97
- PLATFORMS
98
- ruby
99
-
100
- DEPENDENCIES
101
- mutant (~> 0.9.9)
102
- mutant-license!
103
- mutant-rspec (~> 0.9.9)
104
- rspec (~> 3.9)
105
- rspec-core (~> 3.9)
106
- rspec-its (~> 1.2.0)
107
- rubocop (~> 0.79.0)
108
- unparser!
109
-
110
- BUNDLED WITH
111
- 1.17.3
data/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2013 Markus Schirp
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,22 +0,0 @@
1
- require 'devtools'
2
- Devtools.init_rake_tasks
3
-
4
- Rake.application.load_imports
5
- task('metrics:mutant').clear
6
-
7
- namespace :metrics do
8
- task mutant: :coverage do
9
- args = %w[
10
- bundle exec mutant
11
- --ignore-subject Unparser::Buffer#initialize
12
- --include lib
13
- --require unparser
14
- --use rspec
15
- --zombie
16
- --since HEAD~1
17
- ]
18
- args.concat(%w[--jobs 4]) if ENV.key?('CIRCLECI')
19
-
20
- system(*args.concat(%w[-- Unparser*])) or fail "Mutant task failed"
21
- end
22
- end
@@ -1,2 +0,0 @@
1
- ---
2
- unit_test_timeout: 1.0
@@ -1,3 +0,0 @@
1
- ---
2
- threshold: 13
3
- total_score: 638
@@ -1,2 +0,0 @@
1
- ---
2
- threshold: 21.3
@@ -1,6 +0,0 @@
1
- ---
2
- includes:
3
- - lib
4
- integration: rspec
5
- requires:
6
- - unparser
@@ -1,98 +0,0 @@
1
- ---
2
- detectors:
3
- Attribute:
4
- enabled: false
5
- exclude: []
6
- BooleanParameter:
7
- enabled: true
8
- exclude: []
9
- ClassVariable:
10
- enabled: true
11
- exclude: []
12
- ControlParameter:
13
- enabled: true
14
- exclude: []
15
- DataClump:
16
- enabled: true
17
- exclude: []
18
- max_copies: 2
19
- min_clump_size: 2
20
- DuplicateMethodCall:
21
- enabled: false
22
- exclude: []
23
- max_calls: 1
24
- allow_calls: []
25
- FeatureEnvy:
26
- enabled: false
27
- # Buggy smell detector
28
- IrresponsibleModule:
29
- enabled: false
30
- exclude: []
31
- LongParameterList:
32
- enabled: true
33
- exclude: []
34
- max_params: 2
35
- LongYieldList:
36
- enabled: true
37
- exclude: []
38
- max_params: 2
39
- NestedIterators:
40
- enabled: true
41
- exclude: []
42
- max_allowed_nesting: 1
43
- ignore_iterators: []
44
- NilCheck:
45
- enabled: false
46
- RepeatedConditional:
47
- enabled: true
48
- exclude: []
49
- max_ifs: 1
50
- TooManyInstanceVariables:
51
- enabled: true
52
- exclude: []
53
- max_instance_variables: 3
54
- TooManyMethods:
55
- enabled: true
56
- exclude: []
57
- max_methods: 10
58
- TooManyStatements:
59
- enabled: true
60
- exclude: []
61
- max_statements: 7
62
- UncommunicativeMethodName:
63
- enabled: true
64
- exclude: []
65
- reject:
66
- - '/^[a-z]$/'
67
- - '/[0-9]$/'
68
- - '/[A-Z]/'
69
- accept: []
70
- UncommunicativeModuleName:
71
- enabled: true
72
- exclude: []
73
- reject:
74
- - '/^.$/'
75
- - '/[0-9]$/'
76
- accept: []
77
- UncommunicativeParameterName:
78
- enabled: true
79
- exclude: []
80
- reject:
81
- - '/^.$/'
82
- - '/[0-9]$/'
83
- - '/[A-Z]/'
84
- accept: []
85
- UncommunicativeVariableName:
86
- enabled: true
87
- exclude: []
88
- reject:
89
- - '/^.$/'
90
- - '/[0-9]$/'
91
- - '/[A-Z]/'
92
- accept: ['force_utf32']
93
- UnusedParameters:
94
- enabled: true
95
- exclude: []
96
- UtilityFunction:
97
- enabled: true
98
- exclude: []
@@ -1,2 +0,0 @@
1
- ---
2
- threshold: 100
@@ -1,125 +0,0 @@
1
- require 'spec_helper'
2
- describe 'Unparser on ruby corpus', mutant: false do
3
- ROOT = Pathname.new(__FILE__).parent.parent.parent.parent
4
-
5
- TMP = ROOT.join('tmp')
6
-
7
- class Project
8
- include Anima.new(:name, :repo_uri, :repo_ref, :exclude)
9
-
10
- # Perform verification via unparser cli
11
- #
12
- # @return [self]
13
- # if successful
14
- #
15
- # @raise [Exception]
16
- # otherwise
17
- #
18
- def verify
19
- checkout
20
- command = %W(unparser #{repo_path})
21
- exclude.each do |name|
22
- command.concat(%W(--ignore #{repo_path.join(name)}))
23
- end
24
- system(command) do
25
- raise "Verifing #{name} failed!"
26
- end
27
- self
28
- end
29
-
30
- # Checkout repository
31
- #
32
- # @return [self]
33
- #
34
- # @api private
35
- #
36
- def checkout
37
- TMP.mkdir unless TMP.directory?
38
- if repo_path.exist?
39
- Dir.chdir(repo_path) do
40
- system(%w(git pull origin master))
41
- system(%w(git clean -f -d -x))
42
- end
43
- else
44
- system(%W(git clone #{repo_uri} #{repo_path}))
45
- end
46
-
47
- Dir.chdir(repo_path) do
48
- system(%W(git checkout #{repo_ref}))
49
- system(%w(git reset --hard))
50
- system(%w(git clean -f -d -x))
51
- end
52
-
53
- self
54
- end
55
-
56
- private
57
-
58
- # Return repository path
59
- #
60
- # @return [Pathname]
61
- #
62
- # @api private
63
- #
64
- def repo_path
65
- TMP.join(name)
66
- end
67
-
68
- # Helper method to execute system commands
69
- #
70
- # @param [Array<String>] arguments
71
- #
72
- # @api private
73
- #
74
- def system(arguments)
75
- return if Kernel.system(*arguments)
76
-
77
- if block_given?
78
- yield
79
- else
80
- raise "System command #{arguments.inspect} failed!"
81
- end
82
- end
83
-
84
- transform = Mutant::Transform
85
- string = transform::Primitive.new(String)
86
- string_array = transform::Array.new(string)
87
- path = ROOT.join('spec', 'integrations.yml')
88
-
89
- loader =
90
- transform::Named.new(
91
- path.to_s,
92
- transform::Sequence.new(
93
- [
94
- transform::Exception.new(SystemCallError, :read.to_proc),
95
- transform::Exception.new(YAML::SyntaxError, YAML.method(:safe_load)),
96
- transform::Array.new(
97
- transform::Sequence.new(
98
- [
99
- transform::Hash.new(
100
- optional: [],
101
- required: [
102
- transform::Hash::Key.new('exclude', string_array),
103
- transform::Hash::Key.new('name', string),
104
- transform::Hash::Key.new('repo_ref', string),
105
- transform::Hash::Key.new('repo_uri', string)
106
- ]
107
- ),
108
- transform::Hash::Symbolize.new,
109
- transform::Exception.new(Anima::Error, Project.public_method(:new))
110
- ]
111
- )
112
- )
113
- ]
114
- )
115
- )
116
-
117
- ALL = loader.apply(path).lmap(&:compact_message).from_right
118
- end
119
-
120
- Project::ALL.each do |project|
121
- specify "unparsing #{project.name}" do
122
- project.verify
123
- end
124
- end
125
- end
@@ -1,92 +0,0 @@
1
- ---
2
- - name: anima
3
- repo_uri: 'https://github.com/mbj/anima.git'
4
- repo_ref: 'origin/master'
5
- exclude: []
6
- - name: mutant
7
- repo_uri: 'https://github.com/mbj/mutant.git'
8
- repo_ref: 'origin/master'
9
- exclude: []
10
- - name: yaks
11
- repo_uri: 'https://github.com/plexus/yaks.git'
12
- repo_ref: 'origin/master'
13
- exclude: []
14
- - name: chassis
15
- repo_uri: 'https://github.com/ahawkins/chassis.git'
16
- repo_ref: 'origin/master'
17
- exclude: []
18
- - name: rubyspec
19
- repo_uri: 'https://github.com/ruby/spec.git'
20
- # Revision of rubyspec on the last CI build of unparser that passed
21
- repo_ref: 'b40189b88'
22
- exclude:
23
- - command_line/fixtures/bad_syntax.rb
24
- - core/array/pack/shared/float.rb
25
- - core/array/pack/shared/integer.rb
26
- - core/array/pack/shared/string.rb
27
- - core/array/pack/{b,c,h,m}_spec.rb
28
- - core/array/pack/{u,w}_spec.rb
29
- - core/encoding/compatible_spec.rb
30
- - core/encoding/converter/convert_spec.rb
31
- - core/encoding/converter/last_error_spec.rb
32
- - core/encoding/converter/primitive_convert_spec.rb
33
- - core/encoding/converter/primitive_errinfo_spec.rb
34
- - core/encoding/converter/putback_spec.rb
35
- - core/encoding/fixtures/classes.rb
36
- - core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
37
- - core/encoding/invalid_byte_sequence_error/incomplete_input_spec.rb
38
- - core/encoding/invalid_byte_sequence_error/readagain_bytes_spec.rb
39
- - core/encoding/replicate_spec.rb
40
- - core/env/element_reference_spec.rb
41
- - core/io/readpartial_spec.rb
42
- - core/io/shared/gets_ascii.rb
43
- - core/kernel/shared/sprintf_encoding.rb
44
- - core/marshal/dump_spec.rb
45
- - core/marshal/fixtures/marshal_data.rb
46
- - core/marshal/shared/load.rb
47
- - core/random/bytes_spec.rb
48
- - core/regexp/shared/new.rb
49
- - core/regexp/shared/new_ascii.rb
50
- - core/regexp/shared/new_ascii_8bit.rb
51
- - core/regexp/shared/quote.rb
52
- - core/string/byteslice_spec.rb
53
- - core/string/casecmp_spec.rb
54
- - core/string/codepoints_spec.rb
55
- - core/string/count_spec.rb
56
- - core/string/encode_spec.rb
57
- - core/string/inspect_spec.rb
58
- - core/string/shared/codepoints.rb
59
- - core/string/shared/each_codepoint_without_block.rb
60
- - core/string/shared/eql.rb
61
- - core/string/shared/succ.rb
62
- - core/string/shared/to_sym.rb
63
- - core/string/squeeze_spec.rb
64
- - core/string/unpack/shared/float.rb
65
- - core/string/unpack/shared/integer.rb
66
- - core/string/unpack/{b,c,h,m}_spec.rb
67
- - core/string/unpack/{u,w}_spec.rb
68
- - core/symbol/casecmp_spec.rb
69
- - core/time/_dump_spec.rb
70
- - core/time/_load_spec.rb
71
- - language/fixtures/binary_symbol.rb
72
- - language/fixtures/squiggly_heredoc.rb
73
- - language/for_spec.rb
74
- - language/regexp/encoding_spec.rb
75
- - language/regexp/escapes_spec.rb
76
- - language/source_encoding_spec.rb
77
- - language/string_spec.rb
78
- - library/base64/decode64_spec.rb
79
- - library/digest/md5/shared/constants.rb
80
- - library/digest/md5/shared/sample.rb
81
- - library/digest/sha1/shared/constants.rb
82
- - library/digest/sha256/shared/constants.rb
83
- - library/digest/sha384/shared/constants.rb
84
- - library/digest/sha512/shared/constants.rb
85
- - library/openssl/shared/constants.rb
86
- - library/socket/basicsocket/recv_spec.rb
87
- - library/socket/socket/gethostbyname_spec.rb
88
- - library/stringscanner/getch_spec.rb
89
- - library/stringscanner/shared/get_byte.rb
90
- - library/zlib/inflate/set_dictionary_spec.rb
91
- - optional/capi/integer_spec.rb
92
- - security/cve_2010_1330_spec.rb