Skip to content

Commit

Permalink
add shared rubocop style
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 8, 2015
1 parent a85b2c6 commit 692403f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package/yast2-devtools.spec
Expand Up @@ -144,6 +144,7 @@ EOF
%{_datadir}/YaST2/data/devtools/bin/y2makepot
%{_datadir}/YaST2/data/devtools/bin/gettextdomains
%{_datadir}/YaST2/data/devtools/bin/ycp_puttext
%{_datadir}/YaST2/data/devtools/data/.rubocop_yast_style.yml
%dir %{_datadir}/YaST2/control/
%{_datadir}/YaST2/control/control_to_glade.xsl

Expand All @@ -165,7 +166,8 @@ EOF
%endif
# needed for doxygen, not nice
%{_datadir}/YaST2/data/devtools/footer-notimestamp.html
%{_datadir}/YaST2/data/devtools/data
%dir %{_datadir}/YaST2/data/devtools/data
%{_datadir}/YaST2/data/devtools/data/YaST2.dict.txt
%{_datadir}/YaST2/data/devtools/bin/y2autoconf
%{_datadir}/YaST2/data/devtools/bin/y2automake

Expand Down
41 changes: 41 additions & 0 deletions ytools/y2tool/.rubocop_yast_style.yml
@@ -0,0 +1,41 @@
# Rubocop style configuration
#
# Following
# https://github.com/SUSE/style-guides/blob/master/Ruby.md

# https://github.com/SUSE/style-guides/blob/master/Ruby.md#strings
Style/StringLiterals:
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

# Is there any justification for "aligned" which is the default?
Style/MultilineOperationIndentation:
EnforcedStyle: indented

# https://github.com/SUSE/style-guides/blob/master/Ruby.md#arrays
Style/WordArray:
Enabled: false

# align arrows:
# "foo" => true
# "foo_bar" => false
Style/AlignHash:
EnforcedHashRocketStyle: table

# no extra indentation for multiline function calls
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation

# no extra indentation for case
Style/CaseIndentation:
IndentWhenRelativeTo: end

# "unless" has a different connotation than "if not"
Style/NegatedIf:
Enabled: false

# use "raise" instead of "fail"
Style/SignalException:
EnforcedStyle: only_raise
6 changes: 5 additions & 1 deletion ytools/y2tool/Makefile.am
Expand Up @@ -14,4 +14,8 @@ pkgdata_SCRIPTS = \
showy2log \
tagversion

EXTRA_DIST = $(pkgdata_SCRIPTS)
confdatadir = @YAST2DEVTOOLS@/data
confdata_DATA = \
.rubocop_yast_style.yml

EXTRA_DIST = $(pkgdata_SCRIPTS) $(confdata_DATA)

0 comments on commit 692403f

Please sign in to comment.