Skip to content

Commit

Permalink
SuSEFirewall: Move SuSEFirewall{,2,d} classes to new files
Browse files Browse the repository at this point in the history
Yast2 coding standard requires each class to be on a separate file.
As such move SuSEFirewall2, SuSEFirewalld and SuSEFirewall classes
to separate files. These files are being moved to the 'lib/network'
subdirectory as well. Moreover, add a new rubocop configuration file
to silence warnings about variables and methods since these are still
part of the public API.
  • Loading branch information
Markos Chandras committed May 23, 2016
1 parent 7dad17b commit ee352fd
Show file tree
Hide file tree
Showing 7 changed files with 5,326 additions and 5,180 deletions.
11 changes: 0 additions & 11 deletions .rubocop.yml
Expand Up @@ -35,11 +35,6 @@ Style/AccessorMethodName:
Style/ClassAndModuleCamelCase:
Enabled: false

Style/ClassVars:
# We really need the class variables in SuSEFirewall module
Exclude:
- "library/network/src/modules/SuSEFirewall.rb"

# ensure new code is properly documented
Style/Documentation:
Include:
Expand All @@ -53,12 +48,6 @@ Style/MethodName:
Include:
- "library/*/src/lib/**/*.rb"

Style/Next:
# skip this check for SuSEFirewall since it forces us to refactor
# the code in a sub-optimal way.
Exclude:
- "library/network/src/modules/SuSEFirewall.rb"

# keep it as it is part of API for old code
Style/PredicateName:
Include:
Expand Down
5 changes: 4 additions & 1 deletion library/network/src/Makefile.am
Expand Up @@ -26,7 +26,10 @@ agent_SCRIPTS = \

ylibdir = @ylibdir@/network
ylib_DATA = \
lib/network/firewalld.rb
lib/network/firewalld.rb \
lib/network/susefirewall.rb \
lib/network/susefirewall2.rb \
lib/network/susefirewalld.rb

EXTRA_DIST = $(module_DATA) $(scrconf_DATA) $(agent_SCRIPTS) $(ylib_DATA)

Expand Down
21 changes: 21 additions & 0 deletions library/network/src/lib/network/.rubocop.yml
@@ -0,0 +1,21 @@
# use the shared Yast defaults
inherit_from:
- ../../../../../.rubocop.yml

Style/MethodName:
Exclude:
- "susefirewall.rb"
- "susefirewalld.rb"
- "susefirewall2.rb"

Style/Next:
# skip this check for SuSEFirewall modules since it forces us to
# refactor the code in a sub-optimal way.
Exclude:
- "susefirewalld.rb"

Style/VariableName:
Exclude:
- "susefirewall.rb"
- "susefirewalld.rb"
- "susefirewall2.rb"

0 comments on commit ee352fd

Please sign in to comment.