solargraph_frozen_string_literal 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4ea52e90baaf66aca2da05376a66f87adfcd6942515dd695b76b9d034aad2518
4
+ data.tar.gz: 2ad90ee92df4e03de1193318bff2ff8645cb0c6d9dae647dce5d4b28ba127bee
5
+ SHA512:
6
+ metadata.gz: 73a3e8d4ebe7a4c0628baae8864ee5256e417b1ff4f59d6d64047f7e6eb28c31ddb4a7c14a2ddc1a92cb22104d857b8445e93ee56965ed96b54fa5d9227e6825
7
+ data.tar.gz: f0eb1b6791f34cdf78b5a5ef33be844285a507c3aa89af3a01d6d2680d826a1919097e962fb41e28675aba240c0416ac3b40af8169b0992d8e8afc03fe965ce1
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
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 solargraph_frozen_string_literal.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,90 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ solargraph_frozen_string_literal (0.1.0)
5
+ solargraph
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ backport (1.2.0)
12
+ benchmark (0.2.0)
13
+ diff-lcs (1.5.0)
14
+ e2mmap (0.1.0)
15
+ jaro_winkler (1.5.4)
16
+ json (2.6.2)
17
+ kramdown (2.4.0)
18
+ rexml
19
+ kramdown-parser-gfm (1.1.0)
20
+ kramdown (~> 2.0)
21
+ nokogiri (1.13.8-x86_64-darwin)
22
+ racc (~> 1.4)
23
+ parallel (1.22.1)
24
+ parser (3.1.2.1)
25
+ ast (~> 2.4.1)
26
+ racc (1.6.0)
27
+ rainbow (3.1.1)
28
+ rake (13.0.6)
29
+ regexp_parser (2.5.0)
30
+ reverse_markdown (2.1.1)
31
+ nokogiri
32
+ rexml (3.2.5)
33
+ rspec (3.11.0)
34
+ rspec-core (~> 3.11.0)
35
+ rspec-expectations (~> 3.11.0)
36
+ rspec-mocks (~> 3.11.0)
37
+ rspec-core (3.11.0)
38
+ rspec-support (~> 3.11.0)
39
+ rspec-expectations (3.11.0)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.11.0)
42
+ rspec-mocks (3.11.1)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.11.0)
45
+ rspec-support (3.11.0)
46
+ rubocop (1.36.0)
47
+ json (~> 2.3)
48
+ parallel (~> 1.10)
49
+ parser (>= 3.1.2.1)
50
+ rainbow (>= 2.2.2, < 4.0)
51
+ regexp_parser (>= 1.8, < 3.0)
52
+ rexml (>= 3.2.5, < 4.0)
53
+ rubocop-ast (>= 1.20.1, < 2.0)
54
+ ruby-progressbar (~> 1.7)
55
+ unicode-display_width (>= 1.4.0, < 3.0)
56
+ rubocop-ast (1.21.0)
57
+ parser (>= 3.1.1.0)
58
+ ruby-progressbar (1.11.0)
59
+ solargraph (0.46.0)
60
+ backport (~> 1.2)
61
+ benchmark
62
+ bundler (>= 1.17.2)
63
+ diff-lcs (~> 1.4)
64
+ e2mmap
65
+ jaro_winkler (~> 1.5)
66
+ kramdown (~> 2.3)
67
+ kramdown-parser-gfm (~> 1.1)
68
+ parser (~> 3.0)
69
+ reverse_markdown (>= 1.0.5, < 3)
70
+ rubocop (>= 0.52)
71
+ thor (~> 1.0)
72
+ tilt (~> 2.0)
73
+ yard (~> 0.9, >= 0.9.24)
74
+ thor (1.2.1)
75
+ tilt (2.0.11)
76
+ unicode-display_width (2.2.0)
77
+ webrick (1.7.0)
78
+ yard (0.9.28)
79
+ webrick (~> 1.7.0)
80
+
81
+ PLATFORMS
82
+ x86_64-darwin-21
83
+
84
+ DEPENDENCIES
85
+ rake (~> 13.0)
86
+ rspec (~> 3.0)
87
+ solargraph_frozen_string_literal!
88
+
89
+ BUNDLED WITH
90
+ 2.3.22
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 hiroya.shimamoto
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.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # SolargraphFrozenStringLiteral
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/solargraph_frozen_string_literal`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add solargraph_frozen_string_literal
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install solargraph_frozen_string_literal
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/solargraph_frozen_string_literal.
30
+
31
+ ## License
32
+
33
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolargraphFrozenStringLiteral
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,17 @@
1
+ require 'solargraph'
2
+
3
+ class FrozenStringReporter < Solargraph::Diagnostics::Base
4
+ def diagnose source, _api_map
5
+ return [] if source.code.empty? || source.code.start_with?('# frozen_string_literal:')
6
+ [
7
+ {
8
+ range: Solargraph::Range.from_to(0, 0, 0, source.code.lines[0].length),
9
+ severity: Diagnostics::Severities::WARNING,
10
+ source: 'FrozenString',
11
+ message: 'File does not start with frozen_string_literal.'
12
+ }
13
+ ]
14
+ end
15
+ end
16
+
17
+ Solargraph::Diagnostics.register 'frozen-string', FrozenStringReporter
@@ -0,0 +1,4 @@
1
+ module SolargraphFrozenStringLiteral
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: solargraph_frozen_string_literal
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - hiroya.shimamoto
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-09-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: solargraph
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: check if start with frozen_string_literal
28
+ email:
29
+ - shshimamo@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rspec"
35
+ - Gemfile
36
+ - Gemfile.lock
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - lib/solargraph_frozen_string_literal.rb
41
+ - lib/solargraph_frozen_string_literal/version.rb
42
+ - sig/solargraph_frozen_string_literal.rbs
43
+ homepage: https://github.com/shshimamo/solargraph_frozen_string_literal
44
+ licenses:
45
+ - MIT
46
+ metadata:
47
+ allowed_push_host: https://rubygems.org
48
+ homepage_uri: https://github.com/shshimamo/solargraph_frozen_string_literal
49
+ source_code_uri: https://github.com/shshimamo/solargraph_frozen_string_literal
50
+ changelog_uri: https://github.com/shshimamo/solargraph_frozen_string_literal/releases
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 2.6.0
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubygems_version: 3.3.7
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: sample of solargraph plugin
70
+ test_files: []