rubocop-obsession 0.1.2 → 0.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47b14b8bd67398fccc5f92ba6e3e5b30bd76a47ec28a38694183cac973de17e4
|
4
|
+
data.tar.gz: bc60b8d77b8a2353abf4d0d3025161b5c581405507ecbe946f6401e9e3665951
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db8e7698d91d0ab2ef5cb95236164ac2bb0dc754944082c3705d88d87cf99ed1d8bb620cefba7e7817dcfc622d951aca9ee38be76fec566d7a6644a9a1bed111
|
7
|
+
data.tar.gz: 744cc5411803bdf92075645b9aa53d50133078f8491c0edc6bbade699805141b72297b1acabc85ed5321a1cc70a86282d5458bd5eb7df0483174211f153f7250
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# Rubocop Obsession
|
2
2
|
|
3
|
-
A [RuboCop](https://github.com/rubocop/rubocop) extension that
|
4
|
-
higher-level
|
3
|
+
A [RuboCop](https://github.com/rubocop/rubocop) extension that focuses on
|
4
|
+
higher-level concepts, like checking that code reads from
|
5
5
|
[top to bottom](lib/rubocop/cop/obsession/method_order.rb), or only unit
|
6
6
|
testing [public methods](lib/rubocop/cop/obsession/rspec/describe_public_method.rb).
|
7
|
+
There are some lower-level cops as well.
|
7
8
|
|
8
9
|
Use the provided cops as is, or as inspiration to build custom cops aligned
|
9
10
|
with your project's best practices.
|
@@ -66,11 +67,11 @@ end
|
|
66
67
|
|
67
68
|
All cops are located under
|
68
69
|
[`lib/rubocop/cop/obsession`](lib/rubocop/cop/obsession), and contain examples
|
69
|
-
and documentation.
|
70
|
+
and documentation. Their default configuration is defined in
|
71
|
+
[`config/default.yml`](config/default.yml).
|
70
72
|
|
71
|
-
These cops are opinionated and can
|
72
|
-
|
73
|
-
not hesitate to enable or disable them as needed.
|
73
|
+
These cops are opinionated and can feel like too much, that is why some of them
|
74
|
+
are disabled by default. Do not hesitate to enable or disable them as needed.
|
74
75
|
|
75
76
|
I wrote them to scratch an itch I had at one point or another. Tastes change
|
76
77
|
with time, and I personally do not use some of them any more, but others might
|
@@ -3,7 +3,8 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Obsession
|
6
|
-
# This cop checks for private/protected methods that are not ordered
|
6
|
+
# This cop checks for private/protected methods that are not ordered
|
7
|
+
# correctly. It supports autocorrect.
|
7
8
|
#
|
8
9
|
# Code should read from top to bottom: methods should be defined in the
|
9
10
|
# same order as the order when they are first mentioned.
|
@@ -8,12 +8,12 @@ module RuboCop
|
|
8
8
|
# defaults or comments.
|
9
9
|
#
|
10
10
|
# - json(b) fields should have a default value like {} or [] so code can
|
11
|
-
#
|
12
|
-
#
|
11
|
+
# do my_field['field'] or my_field.first without fear that my_field is
|
12
|
+
# nil.
|
13
13
|
# - It is impossible to know the structure of a json(b) field just by
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
14
|
+
# reading the schema, because json(b) is an unstructured type. That's why
|
15
|
+
# an "Example: ..." Postgres comment should always be present when
|
16
|
+
# defining the field.
|
17
17
|
#
|
18
18
|
# @example
|
19
19
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-obsession
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jerome Dalbert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|