accessiblerb 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c75a133e2c5a7b35fbe21471678ecf34e6216e6bae5561e4b9e22c06819f6085
4
+ data.tar.gz: 4247620387bb76a06c2da46611260393c1b1102201c97ff10793e101ca742754
5
+ SHA512:
6
+ metadata.gz: 29189bf0c989a4aa4badfe83750c65c261660663ea478edc2837d7b3d15f3433bd23d608cb23971fb28a11bbb49f58d87d3ce805675c6ba0ccf8ea828b113214
7
+ data.tar.gz: e4f90aa788ba7ca325afd2badfd8f61a8bbcf8f364362fa1dad4957f60fe1301f200441ccfc1c6dc17ce1e6c64800be8945c73227b8bc56481b34501969f0a93
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ ### Releases
2
+
3
+ #### [0.1.0] - 2023-11-26
4
+
5
+ The initial release containing a base set of rules to be expanded upon later.
6
+ The rules contained within are related to:
7
+
8
+ - Quoting strings
9
+ - Documenting methods
10
+ - Indentation modes
11
+ - Alignment of lines
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Stephan Tarulli
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ ### 🎁 accessiblerb
2
+
3
+ A set of Rubocop rules focused on accessiblity and legibility without concern
4
+ for existing community standards.
5
+
6
+ #### Why?
7
+
8
+ All of the existing tools, like standardrb or the Ruby style guide, do not
9
+ consider the consequences of their defaults on the wide variety of people
10
+ using Ruby day to day.
11
+
12
+ #### What can I expect?
13
+
14
+ This set of rules focuses on reduced nesting of code and accessibility for
15
+ the reader. It breaks with the community entirely in several areas like indent
16
+ styles.
17
+
18
+ Rules will evoke immediate disagreement from some, but they are all considered
19
+ using real code and the following guidelines:
20
+
21
+ - it improves the experience of Rubyists with any form of visual impairment
22
+ - it eases programming for Rubyists with hand impairments
23
+ - it improves working memory burden by eliminating nested scopes
24
+ - it improves legibility by reducing rightward drift in statements and expressions
25
+ - it improves ease of understanding Ruby code
26
+
27
+ #### Quickstart
28
+
29
+ To use this gem, install it:
30
+
31
+ gem install accessiblerb
32
+
33
+ Then configure Rubocop:
34
+
35
+ # inside of your .rubocop.yml
36
+ inherit_gem:
37
+ accessiblerb: rules.yml
data/accessibility.yml ADDED
@@ -0,0 +1,62 @@
1
+ #=============================================================================#
2
+ # Accessibility Rules
3
+ #
4
+ # The rules in this file aim to make Ruby code accessible to individuals with
5
+ # visual impairments and generally improve ease of reading for everyone.
6
+ #=============================================================================#
7
+
8
+ # This is the big one; the one most people will absolutely disagree with, but
9
+ # it is critical.
10
+ #
11
+ # The 2 space indentation rule the Ruby community uses creates a large amount
12
+ # of friction for anyone with visual impairments. It's not ok to force people
13
+ # to jump through indentation conversion hoops to participate in a community.
14
+ #
15
+ # Tabs provide the accessibility seam necessary for everyone to read code.
16
+ Layout/IndentationStyle:
17
+ EnforcedStyle: tabs
18
+
19
+ # A consequence of using tabs is that only 1 character is ever used for any
20
+ # indentation level.
21
+ #
22
+ # The entire concept of an indentation width disappears from static analysis
23
+ # tools and only has meaning within the person's display configuration.
24
+ Layout/IndentationWidth:
25
+ Width: 1
26
+
27
+ # Many languages with terminator characters use leading dot syntax as a way to
28
+ # continue a method chain across lines. Ruby does not require any terminator
29
+ # character.
30
+ #
31
+ # When reading top-down it is useful to have the dot as a trailing character
32
+ # indicating the line continues. This is the opposite of languages like English
33
+ # where the absence of a full stop indicates continuation.
34
+ Layout/DotPosition:
35
+ EnforcedStyle: trailing
36
+
37
+ # Indenting to receiver and alignment cause a large amount of righward drift
38
+ # in codebases while requiring extra typing work to maintain these alignments
39
+ # as code changes over time.
40
+ #
41
+ # Simple indentation for method calls eliminates most of the rightward drift
42
+ # while providing lower strain maintenance. It reduces the distance your eyes
43
+ # scan to read the method call and the next lines.
44
+ Layout/MultilineMethodCallIndentation:
45
+ EnforcedStyle: indented
46
+
47
+ # This is one of the only pieces of configuration that purposely adds rightward
48
+ # drift to the codebase, but does so for good reason: visual distinction of
49
+ # access control sections within classes.
50
+ #
51
+ # This small amount of rightward drift makes these areas distinct and provides
52
+ # incentive to eliminate them by making smaller classes.
53
+ Layout/IndentationConsistency:
54
+ EnforcedStyle: indented_internal_methods
55
+
56
+ # Separating chained method calls allows you to visualize complexity as a
57
+ # function of the number of lines and ease understanding of the individual
58
+ # parts of the transformation while eliminating rightward drift.
59
+ #
60
+ # The extra lines are additional incentive to encapsulate these details.
61
+ Layout/SingleLineBlockChain:
62
+ Enabled: true
data/base.yml ADDED
@@ -0,0 +1,22 @@
1
+ #=============================================================================#
2
+ # Base Rules
3
+ #
4
+ # The rules in this file establish a common base for Ruby files to avoid areas
5
+ # of inconsistency across platforms. There aren't many of these, but keeping
6
+ # them separate allows for the other files to focus exclusively on legibility
7
+ # and accessibility.
8
+ #=============================================================================#
9
+
10
+ # Use universal line feed characters as the line break character to avoid
11
+ # inconsistencies across platforms.
12
+ Layout/EndOfLine:
13
+ EnforcedStyle: lf
14
+
15
+ # Double quoted string literals match the majority of other languages and don't
16
+ # break the flow of work when interpolation is necessary. Other literals can be
17
+ # used for the few cases it improves legibility.
18
+ Style/StringLiterals:
19
+ EnforcedStyle: double_quotes
20
+
21
+ Style/StringLiteralsInInterpolation:
22
+ EnforcedStyle: double_quotes
data/legibility.yml ADDED
@@ -0,0 +1,16 @@
1
+ #=============================================================================#
2
+ # Legibility Rules
3
+ #
4
+ # The rules in this file aim to make Ruby easy to understand for all future
5
+ # readers of any file.
6
+ #=============================================================================#
7
+
8
+ # Documentation is important for giving future readers a quick understanding of
9
+ # what your classes and methods do. It is your opportunity to clearly define
10
+ # how to use the public API of a class.
11
+ #
12
+ # There is a large amount of wasted development time across companies because
13
+ # of poor public API documentation.
14
+ Style/DocumentationMethod:
15
+ Enabled: true
16
+ RequireForNonPublicMethods: false
data/rules.yml ADDED
@@ -0,0 +1,11 @@
1
+ #=============================================================================#
2
+ # Accessible Ruby Rules
3
+ #
4
+ # This file combines all the others. Look in each to see the rules and reasons
5
+ # for their configuration.
6
+ #=============================================================================#
7
+
8
+ inherit_from:
9
+ - base.yml
10
+ - accessibility.yml
11
+ - legibility.yml
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: accessiblerb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Stephan Tarulli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-11-27 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - srt@tinychameleon.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - CHANGELOG.md
21
+ - LICENSE.txt
22
+ - README.md
23
+ - accessibility.yml
24
+ - base.yml
25
+ - legibility.yml
26
+ - rules.yml
27
+ homepage: https://github.com/tinychameleon/accessiblerb
28
+ licenses:
29
+ - MIT
30
+ metadata:
31
+ allowed_push_host: https://rubygems.org
32
+ homepage_uri: https://github.com/tinychameleon/accessiblerb
33
+ source_code_uri: https://github.com/tinychameleon/accessiblerb
34
+ changelog_uri: https://github.com/tinychameleon/accessiblerb/blob/main/CHANGELOG.md
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.7.0
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubygems_version: 3.4.20
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Write accessible Ruby with this set of Rubocop rules.
54
+ test_files: []