rubocop-disable_syntax 0.1.0 → 0.1.1

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: 2043bf5a5a0901cb7335082d5536484f634272a0a3f9cc6d8146e75b2663a0ab
4
- data.tar.gz: 9a87b08496dc0cd0b42c6ee5a373cc9b6d5f42166148f15f7f26939f3b8d1259
3
+ metadata.gz: 50dac881cbd8b4b939190072c476eda46c0dc7c5575a7d41278cbca8a7b9fe64
4
+ data.tar.gz: e57d900d34b589085f2f1a12065dbb8d14be335e042ebf0861a9265abad7127c
5
5
  SHA512:
6
- metadata.gz: 7501434582cfcae34bb8c03ea062cefa44201d3c51cd308a7ea1f33de68ef4d3410dde6c82221bcbee1867c0460b4edacd6ba12d8381c2ede6ba93b56255bbbf
7
- data.tar.gz: 5ac9ed8490f18910f3b27a9157a143b2e7751dde4a81e921ec126567f5984d74d37a00c153f2f5811b593c99e24b8285e58c9b6f8f6fb09fc287d72e139f23fb
6
+ metadata.gz: 972f20e621435f29c046ea6edf82003ee5d45711d4ecfd6b3e57eb4754b2c655bd3a3bc7b7656f85019527b6e7cf56234ef0247d10da790e8662618995349410
7
+ data.tar.gz: f78f9bc0381d458dd5088c19b853840e1c98b027a10d6da59695a04cc23b063ce8cdfdf1999819a47a2707a603bf5bc2a121648f6be8e6356a8f1275cdccc633
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## 0.1.1 (2023-10-13)
4
+
5
+ - Mark cop as unsafe to autocorrect
6
+
3
7
  ## 0.1.0 (2023-09-26)
4
8
 
5
9
  - First release
data/config/default.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  Style/DisableSyntax:
2
2
  Description: 'Forbid some unfavorite ruby syntax, such as `unless`, safe navigation etc.'
3
3
  Enabled: true
4
+ SafeAutoCorrect: false
4
5
  VersionAdded: '0.1'
5
6
  SupportedDisableSyntax:
6
7
  - unless
@@ -3,6 +3,25 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Style
6
+ # Forbid some unfavorite ruby syntax, such as `unless`, safe navigation etc.
7
+ #
8
+ # @safety
9
+ # Autocorrection is unsafe because there is a different operator precedence
10
+ # between logical operators (`&&`, `||` and `!`) and semantic operators (`and`, `or` and `not`),
11
+ # and that might change the behavior.
12
+ #
13
+ # You can set syntax you want to disable via `DisableSyntax`.
14
+ # Available are: 'unless', 'ternary', 'safe_navigation', 'endless_methods',
15
+ # 'arguments_forwarding', 'numbered_parameters', 'pattern_matching',
16
+ # 'shorthand_hash_syntax', 'and_or_not', 'until', and 'percent_literals'.
17
+ #
18
+ # @example DisableSyntax: ['unless']
19
+ # # bad
20
+ # do_something unless condition
21
+ #
22
+ # # good
23
+ # do_something if !condition
24
+ #
6
25
  class DisableSyntax < Base
7
26
  extend AutoCorrector
8
27
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module DisableSyntax
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-disable_syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - fatkodima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-26 00:00:00.000000000 Z
11
+ date: 2023-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop