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 +4 -4
- data/CHANGELOG.md +4 -0
- data/config/default.yml +1 -0
- data/lib/rubocop/cop/style/disable_syntax.rb +19 -0
- data/lib/rubocop/disable_syntax/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50dac881cbd8b4b939190072c476eda46c0dc7c5575a7d41278cbca8a7b9fe64
|
4
|
+
data.tar.gz: e57d900d34b589085f2f1a12065dbb8d14be335e042ebf0861a9265abad7127c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 972f20e621435f29c046ea6edf82003ee5d45711d4ecfd6b3e57eb4754b2c655bd3a3bc7b7656f85019527b6e7cf56234ef0247d10da790e8662618995349410
|
7
|
+
data.tar.gz: f78f9bc0381d458dd5088c19b853840e1c98b027a10d6da59695a04cc23b063ce8cdfdf1999819a47a2707a603bf5bc2a121648f6be8e6356a8f1275cdccc633
|
data/CHANGELOG.md
CHANGED
data/config/default.yml
CHANGED
@@ -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
|
|
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.
|
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-
|
11
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|