Skip to content

Commit

Permalink
rubocop: enable Style/MutableConstant
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 28, 2023
1 parent a392d23 commit 210fed8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 18 deletions.
11 changes: 0 additions & 11 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,3 @@ Style/Documentation:
# Frozen strings are too dangerous to switch now
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'src/include/security/widgets.rb'
- 'src/lib/security/ctrl_alt_del_config.rb'
- 'src/lib/security/display_manager.rb'
- 'src/modules/Security.rb'
4 changes: 2 additions & 2 deletions src/include/security/widgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ module SecurityWidgetsInclude
"ignore" => N_("Ignore"),
"reboot" => N_("Reboot"),
"halt" => N_("Halt")
}
}.freeze

SHUTDOWN_LABELS = {
"root" => N_("Only root"),
"all" => N_("All Users"),
"none" => N_("Nobody")
}
}.freeze

def initialize_security_widgets(_include_target)
textdomain "security"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/security/ctrl_alt_del_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module CtrlAltDelConfig
Yast.import "Package"
Yast.import "FileUtils"

SYSTEMD_FILE = "/etc/systemd/system/ctrl-alt-del.target"
SYSTEMD_FILE = "/etc/systemd/system/ctrl-alt-del.target".freeze

class << self
def systemd?
Expand Down
4 changes: 2 additions & 2 deletions src/lib/security/display_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ module Security
class DisplayManager
Yast.import "SCR"

CONFIG_PATH = ".sysconfig.displaymanager.DISPLAYMANAGER"
CONFIG_PATH = ".sysconfig.displaymanager.DISPLAYMANAGER".freeze

SYSCONFIG_COMMON_LOCATIONS = [
"DISPLAYMANAGER_REMOTE_ACCESS",
"DISPLAYMANAGER_ROOT_LOGIN_REMOTE",
"DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN"
]
].freeze

private_class_method :new
attr_reader :name
Expand Down
4 changes: 2 additions & 2 deletions src/modules/Security.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ class SecurityClass < Module # rubocop:disable Metrics/ClassLength
SYSCTL_VALUES_TO_BOOLEAN = {
"yes" => true,
"no" => false
}
}.freeze
SYSCTL_VALUES_TO_INTSTRING = {
"yes" => "1",
"no" => "0"
}
}.freeze

SHADOW_ATTRS = [
"FAIL_DELAY",
Expand Down

0 comments on commit 210fed8

Please sign in to comment.