Skip to content

Commit 815735e

Browse files
committed
complete line length normalization
1 parent 5109f9d commit 815735e

File tree

6 files changed

+25
-57
lines changed

6 files changed

+25
-57
lines changed

.rubocop.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,12 @@ AllCops:
1111
TargetRubyVersion: 2.7
1212
SuggestExtensions: false
1313

14-
# The `ConfigValidator` class is a DSL, give it some complexity leeway
15-
Metrics/AbcSize:
16-
Exclude:
17-
- lib/bashly/config_validator.rb
18-
19-
# (same as previous rule)
20-
Metrics/CyclomaticComplexity:
21-
Exclude:
22-
- lib/bashly/config_validator.rb
23-
24-
# (same as previous rule)
25-
Metrics/PerceivedComplexity:
26-
Exclude:
27-
- lib/bashly/config_validator.rb
28-
29-
# (same as previous rule)
30-
Metrics/MethodLength:
31-
Exclude:
32-
- lib/bashly/config_validator.rb
33-
34-
# Guard clauses are inconsistent in the case of `ConfigValidator`
35-
Style/GuardClause:
36-
Exclude:
37-
- lib/bashly/config_validator.rb
14+
# The `ConfigValidator` class is a DSL, let it be
15+
Metrics/AbcSize: { Exclude: [lib/bashly/config_validator.rb] }
16+
Metrics/CyclomaticComplexity: { Exclude: [lib/bashly/config_validator.rb] }
17+
Metrics/PerceivedComplexity: { Exclude: [lib/bashly/config_validator.rb] }
18+
Metrics/MethodLength: { Exclude: [lib/bashly/config_validator.rb] }
19+
Style/GuardClause: { Exclude: [lib/bashly/config_validator.rb] }
3820

3921
# Allow irregular filenames in some cases
4022
RSpec/FilePath:

lib/bashly/commands/add.rb

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,17 @@ class Add < Base
2929
In all cases, this is optional and will have sensible defaults.
3030
USAGE
3131

32-
command 'colors',
33-
'Add standard functions for printing colorful and formatted text to the ' \
34-
'lib directory.'
35-
32+
command 'colors', 'Add standard functions for printing colorful and formatted text to the lib directory.'
3633
command 'comp', 'Generate a bash completions script or function.'
3734
command 'config', 'Add standard functions for handling INI files to the lib directory.'
38-
command 'lib',
39-
'Create the additional lib directory for additional user scripts. ' \
40-
'All *.sh scripts in this folder will be included in the final bash script.'
35+
command 'lib', 'Create the additional lib directory for additional user scripts. All *.sh scripts in this ' \
36+
'folder will be included in the final bash script.'
4137

42-
command 'settings',
43-
'Copy a sample settings.yml file to your project, ' \
44-
'allowing you to customize some bashly options.'
38+
command 'settings', 'Copy a sample settings.yml file to your project, allowing you to customize some ' \
39+
'bashly options.'
4540

46-
command 'strings',
47-
'Copy an additional configuration file to your project, ' \
48-
'allowing you to customize all the tips and error strings.'
41+
command 'strings', 'Copy an additional configuration file to your project, allowing you to customize all the ' \
42+
'tips and error strings.'
4943

5044
command 'test', 'Add approval testing.'
5145
command 'validations', 'Add argument validation functions to the lib directory.'
@@ -54,11 +48,9 @@ class Add < Base
5448
example 'bashly add comp function'
5549
example 'bashly add comp script completions.bash'
5650

57-
environment 'BASHLY_SOURCE_DIR',
58-
'The path containing the bashly configuration and source files [default: src]'
59-
60-
environment 'BASHLY_LIB_DIR',
61-
'The path to use for creating the library files, relative to the source dir [default: lib]'
51+
environment 'BASHLY_SOURCE_DIR', 'The path containing the bashly configuration and source files [default: src]'
52+
environment 'BASHLY_LIB_DIR', 'The path to use for creating the library files, relative to the source dir ' \
53+
'[default: lib]'
6254

6355
attr_reader :skip_src_check
6456

lib/bashly/commands/generate.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Generate < Base
2525
environment 'BASHLY_STRICT', 'When not empty, enable bash strict mode (set -euo pipefail)'
2626
environment 'BASHLY_TAB_INDENT',
2727
'When not empty, the generated script will use tab indentation instead of spaces ' \
28-
'(every 2 leading spaces will be converted to a tab character)'
28+
'(every 2 leading spaces will be converted to a tab character)'
2929

3030
environment 'BASHLY_ENV', <<~HELP
3131
Set to 'production' or 'development':
@@ -110,8 +110,8 @@ def upgrade(existing_file, library_name, *args)
110110
if Library.exist? library_name
111111
upgrade! existing_file, library_name, *args
112112
else
113-
quiet_say "!txtred!warning!txtrst! not upgrading !txtcyn!#{existing_file}!txtrst!, ' \
114-
'unknown library '#{library_name}'"
113+
quiet_say "!txtred!warning!txtrst! not upgrading !txtcyn!#{existing_file}!txtrst!, " \
114+
"unknown library '#{library_name}'"
115115
end
116116
end
117117

lib/bashly/commands/init.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ module Bashly
22
module Commands
33
class Init < Base
44
summary 'Initialize a new workspace'
5-
help 'This command will create the source folder, and place a template ' \
6-
'configuration file in it.'
5+
help 'This command will create the source folder, and place a template configuration file in it.'
76

87
usage 'bashly init [--minimal]'
98
usage 'bashly init (-h|--help)'
109

1110
option '-m --minimal', 'Use a minimal configuration file (without commands)'
1211

13-
environment 'BASHLY_SOURCE_DIR',
14-
'The path to use for creating the configuration file [default: src]'
12+
environment 'BASHLY_SOURCE_DIR', 'The path to use for creating the configuration file [default: src]'
1513

1614
def run
1715
if Dir.exist?(target_dir) && !Dir.empty?(target_dir)

lib/bashly/commands/preview.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ class Preview < Base
66
usage 'bashly preview'
77
usage 'bashly preview (-h|--help)'
88

9-
environment 'BASHLY_SOURCE_DIR',
10-
'The path containing the bashly configuration and source files [default: src]'
9+
environment 'BASHLY_SOURCE_DIR', 'The path containing the bashly configuration and source files [default: src]'
1110

1211
def run
1312
with_valid_config do

lib/bashly/commands/validate.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ class Validate < Base
66
usage 'bashly validate [--verbose]'
77
usage 'bashly validate (-h|--help)'
88

9-
option '-v --verbose',
10-
'Show the bashly configuration file prior to validating. ' \
11-
'This is useful when using split config (import) since it will show ' \
12-
'the final compiled configuration.'
9+
option '-v --verbose', 'Show the bashly configuration file prior to validating. ' \
10+
'This is useful when using split config (import) since it will show the final compiled configuration.'
1311

14-
environment 'BASHLY_SOURCE_DIR',
15-
'The path containing the bashly configuration and source files [default: src]'
12+
environment 'BASHLY_SOURCE_DIR', 'The path containing the bashly configuration and source files [default: src]'
1613

1714
def run
1815
if args['--verbose']

0 commit comments

Comments
 (0)