rubocop-sorted 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b575aca29799efa90eee8e8e72783f66c668e6bc4d9d5c313b2d465a4570d054
4
- data.tar.gz: 3f185d6fef21a48d0da5f8e470a3a6a8fe659b1b78403689eefbe484bd3d0a1e
3
+ metadata.gz: fe1c4a383131699f151d38e89657bb112a73fa20fa99d8b8c8188bfbc29ecdba
4
+ data.tar.gz: dfd8c4582e824077a99573959237fb05d34ab063fcd22cd37f017d52478e78cc
5
5
  SHA512:
6
- metadata.gz: 4374fe341891ad794e333f67f5602b7f7e2de7aefe250bfae0217885db2eb0352637a6bd05aa5b41593ed66500b7adea03724d3ce3feff4443f5ed0002e9be95
7
- data.tar.gz: 01a5c441cd0ce064102cb46e54c92facc514a9df0f67670361bba2c6916473bd10ceb187c31f4500c656f036ba0b034ac3452e44ceea8200d7801ba380dfc26c
6
+ metadata.gz: 1d71a1c0300f6ea3a18fd8f95042ba5366571dcae0f7046f95d02931c4f18bfb20c5e94c594aab0ac0b9c0aff80540d2ea1416e880fec0fab7cbd5388c9e1302
7
+ data.tar.gz: 1c4d911517a3fd628a7c12738fa2c75e51079b7944758969e94fde1f2f9023edd8bf57009baf940bb40bd5db156f43800e8e8827d29a10a1e70687d55aeb5b21
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Rubocop::Sorted
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/rubocop-sorted.svg)](https://badge.fury.io/rb/rubocop-sorted)
3
4
  ![ruby workflow](https://github.com/HeroProtagonist/rubocop-sorted/actions/workflows/ruby.yml/badge.svg)
4
5
 
5
6
  [Rubocop](https://github.com/rubocop/rubocop) extension used to enforce that the keys of a hash are sorted alphabetically
@@ -3,44 +3,22 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Sorted
6
- # TODO: Write cop description and example of bad / good code. For every
7
- # `SupportedStyle` and unique configuration, there needs to be examples.
8
- # Examples must have valid Ruby syntax. Do not use upticks.
9
- #
10
- # @safety
11
- # Delete this section if the cop is not unsafe (`Safe: false` or
12
- # `SafeAutoCorrect: false`), or use it to explain how the cop is
13
- # unsafe.
14
- #
15
- # @example EnforcedStyle: bar (default)
16
- # # Description of the `bar` style.
17
- #
18
- # # bad
19
- # bad_bar_method
6
+ # Checks that the keys of a hash are sorted alphabetically when enabled.
7
+ # The configuration option `VariableNamesToCheck` can be set to an array
8
+ # of strings. Only hashes assigned to variables matching the supplied
9
+ # names will be inspected. By default, this option is not set.
20
10
  #
21
11
  # # bad
22
- # bad_bar_method(args)
23
- #
24
- # # good
25
- # good_bar_method
26
- #
27
- # # good
28
- # good_bar_method(args)
29
- #
30
- # @example EnforcedStyle: foo
31
- # # Description of the `foo` style.
32
- #
33
- # # bad
34
- # bad_foo_method
35
- #
36
- # # bad
37
- # bad_foo_method(args)
38
- #
39
- # # good
40
- # good_foo_method
12
+ # hash = {
13
+ # z: 1,
14
+ # a: 2
15
+ # }
41
16
  #
42
17
  # # good
43
- # good_foo_method(args)
18
+ # hash = {
19
+ # a: 2,
20
+ # z: 1
21
+ # }
44
22
  #
45
23
  class SortHashKeys < Base
46
24
  extend AutoCorrector
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Sorted
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-sorted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - HeroProtagonist
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop