slimembedcop 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2de74f977f0c9b3d8668fb691ea042033412e2feee2b77638dca4d60bbac30a4
4
- data.tar.gz: 7aea53f38ce0c1c3965cdcda6ffd4ad0260b0242d09aaae610484114f0580f1b
3
+ metadata.gz: 819399a1940beed5d69493debeb14cc9ca337274d4c94a015aa4fa7cb4a61576
4
+ data.tar.gz: a9513d7bcc2b2df861fa0b9509542ef83f2b7caa4757d9a986d626d2305ce5d2
5
5
  SHA512:
6
- metadata.gz: 63bead9c81a50545c49bc6b039b1362109b59710cd45e50ab88f2375e77089182320e6c624f8297b355521d5b3f6a99758008f087db6d2c843aa5942a7e623dc
7
- data.tar.gz: db4c9e49e42d4fa6157627e4ad0f9497c114072a22b4944181b9308ef9a749d6b49763c0f25644465c034044f5be48b016e226295660c2b2983c1c5454f252a7
6
+ metadata.gz: b193c4391dadc3d800d2a9b6ae62dad2d0ce3e52450e3c292a7f30971bc82b622ce268d7b5a15e59d36c9ab627d7b476971d5cf4158e7e4ede005e4458b50fbb
7
+ data.tar.gz: 38dec3b0af1d1d4702297a6f0cdb01732ff9075fa2aa48258c5588b8e0caffc4f1b493956a3c8d4efc71d70dae502fb9808aa7c1dcacea47cdf7c002fcc29521
data/.codespellignore ADDED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.0.0 - 2024-11-29
4
+
5
+ - Fix warnings for use of `Team.new`.
6
+
3
7
  ## 0.2.0 - 2023-09-16
4
8
 
5
9
  - Disable unnecessary cop for slimembedcop.
data/README.md CHANGED
@@ -1,6 +1,100 @@
1
- # Slimembedcop
1
+ # SlimEmbedCop
2
2
 
3
- RuboCop runner for Ruby code embedded in Slim.
3
+ [![Gem Version](https://badge.fury.io/rb/slimembedcop.svg)](https://badge.fury.io/rb/slimembedcop)
4
+ [![CI](https://github.com/ydah/slimembedcop/actions/workflows/ci.yml/badge.svg)](https://github.com/ydah/slimembedcop/actions/workflows/ci.yml)
5
+ [![RubyDoc](https://img.shields.io/badge/%F0%9F%93%9ARubyDoc-documentation-informational.svg)](https://www.rubydoc.info/gems/slimembedcop)
6
+
7
+
8
+ [RuboCop](https://github.com/rubocop/rubocop) runner for [Ruby code embedded in Slim](https://github.com/slim-template/slim#embedded-engines-markdown-).
9
+
10
+ ## Installation
11
+
12
+ **SlimEmbedCop**'s installation is pretty standard:
13
+
14
+ ```sh
15
+ % gem install slimembedcop
16
+ ```
17
+
18
+ If you'd rather install SlimEmbedCop using `bundler`, add a line for it in your `Gemfile` (but set the `require` option to `false`, as it is a standalone tool):
19
+
20
+ ```ruby
21
+ gem 'slimembedcop', require: false
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ Use `slimembedcop` executable to check offenses and autocorrect them.
27
+ [RuboCop's cop](https://docs.rubocop.org/rubocop/1.56/cops.html) or any [custom cop](https://docs.rubocop.org/rubocop/extensions.html#custom-cops) you create can also be used with `slimembedcop`.
28
+
29
+ ```sh
30
+ % exe/slimembedcop --help
31
+ Usage: slimembedcop [options] [file1, file2, ...]
32
+ -v, --version Display version.
33
+ -a, --autocorrect Autocorrect offenses.
34
+ -c, --config= Specify configuration file.
35
+ --[no-]color Force color output on or off.
36
+ -d, --debug Display debug info.
37
+ ```
38
+
39
+ ### Example
40
+
41
+ You have a Slim file like this:
42
+
43
+ ```ruby
44
+ ruby:
45
+ message = "world"
46
+ html
47
+ head
48
+ title Slim Samples
49
+ body
50
+ ruby:
51
+ if some_var = true
52
+ do_something
53
+ end
54
+ h1 Hello, #{message}
55
+ ruby:
56
+ do_something /pattern/i
57
+ ```
58
+
59
+ When executed, it outputs the following offenses:
60
+
61
+ ```sh
62
+ % slimembedcop dummy.slim
63
+ Inspecting 1 file
64
+ W
65
+
66
+ Offenses:
67
+
68
+ dummy.slim:2:13: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
69
+ message = "world"
70
+ ^^^^^^^
71
+ dummy.slim:8:19: W: [Correctable] Lint/AssignmentInCondition: Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
72
+ if some_var = true
73
+ ^
74
+ dummy.slim:13:16: W: [Correctable] Lint/AmbiguousRegexpLiteral: Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the / if it should be a division.
75
+ do_something /pattern/i
76
+ ^
77
+
78
+ 1 file inspected, 3 offenses detected, 3 offenses autocorrectable
79
+ ```
80
+
81
+ ## Configuration
82
+
83
+ The behavior of [RuboCop](https://github.com/rubocop/rubocop) can be controlled via the [.rubocop.yml](https://github.com/rubocop/rubocop/blob/master/.rubocop.yml) configuration file. The behavior of `SlimEmbedCop` can be controlled by the `.slimembedcop.yml` configuration file. It makes it possible to enable/disable certain cops (checks) and to alter their behavior if they accept any parameters. The file can be placed in your home directory, XDG config directory, or in some project directory.
84
+
85
+ The file has the following format:
86
+
87
+ ```yaml
88
+ inherit_from: ../.rubocop.yml
89
+
90
+ Style/Encoding:
91
+ Enabled: false
92
+
93
+ Layout/LineLength:
94
+ Max: 99
95
+ ```
96
+
97
+ NOTE: It is basically the same as RuboCop's. Please check [Configuration](https://docs.rubocop.org/rubocop/configuration.html) for details.
4
98
 
5
99
  ## License
6
100
 
@@ -29,7 +29,7 @@ module Slimembedcop
29
29
  end
30
30
 
31
31
  def team
32
- ::RuboCop::Cop::Team.new(
32
+ ::RuboCop::Cop::Team.mobilize(
33
33
  registry,
34
34
  @config,
35
35
  autocorrect: @autocorrect,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Slimembedcop
4
- VERSION = '0.2.0'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimembedcop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - Yudai Takada
8
- autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-15 00:00:00.000000000 Z
11
+ date: 2024-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -24,7 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
- description:
28
27
  email:
29
28
  - t.yudai92@gmail.com
30
29
  executables:
@@ -32,6 +31,7 @@ executables:
32
31
  extensions: []
33
32
  extra_rdoc_files: []
34
33
  files:
34
+ - ".codespellignore"
35
35
  - ".rspec"
36
36
  - ".rubocop.yml"
37
37
  - CHANGELOG.md
@@ -61,7 +61,6 @@ metadata:
61
61
  source_code_uri: https://github.com/ydah/slimembedcop
62
62
  changelog_uri: https://github.com/ydah/slimembedcop/releases
63
63
  rubygems_mfa_required: 'true'
64
- post_install_message:
65
64
  rdoc_options: []
66
65
  require_paths:
67
66
  - lib
@@ -76,8 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
75
  - !ruby/object:Gem::Version
77
76
  version: '0'
78
77
  requirements: []
79
- rubygems_version: 3.3.7
80
- signing_key:
78
+ rubygems_version: 3.6.0.dev
81
79
  specification_version: 4
82
80
  summary: RuboCop runner for Ruby code embedded in Slim.
83
81
  test_files: []