Skip to content

Commit

Permalink
Fix the lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Aravinda Vishwanathapura <[email protected]>
  • Loading branch information
aravindavk committed May 31, 2024
1 parent b84f710 commit 22afa6b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fmt-check:

lint:
cd lint && shards install
./lint/bin/ameba src
./lint/bin/ameba --except Documentation/DocumentationAdmonition src

fmt:
crystal tool format src
2 changes: 1 addition & 1 deletion lint/shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ version: 2.0
shards:
ameba:
git: https://github.com/crystal-ameba/ameba.git
version: 1.0.0
version: 1.6.1

1 change: 0 additions & 1 deletion lint/shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ license: GPLv3
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: 1.0.0
6 changes: 3 additions & 3 deletions src/args.cr
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ module GlusterMetricsExporter
@@config.gluster_host = name
end

parser.on("-v", "--verbose", "Enable verbose output (default: #{@@config.verbose})") do
parser.on("-v", "--verbose", "Enable verbose output (default: #{@@config.verbose?})") do
@@config.verbose = true
end

parser.on("--disable-all", "Disable all Metrics (default: #{@@config.disable_all_metrics})") do
parser.on("--disable-all", "Disable all Metrics (default: #{@@config.disable_all_metrics?})") do
@@config.disable_all_metrics = true
end

parser.on("--disable-volumes-all", "Disable all Volumes (default: #{@@config.disable_volumes_all})") do
parser.on("--disable-volumes-all", "Disable all Volumes (default: #{@@config.disable_volumes_all?})") do
@@config.disable_volumes_all = true
end

Expand Down
9 changes: 5 additions & 4 deletions src/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ module GlusterMetricsExporter

property metrics_path = "/metrics",
port = 9713,
disable_volumes_all = false,
gluster_executable_path = "/usr/sbin/gluster",
disable_all_metrics = false,
log_level = "info",
log_dir = "/var/log/gluster-metrics-exporter",
log_file = "exporter.log",
gluster_log_dir = "/var/log/glusterfs",
glusterd_dir = "/var/lib/glusterd",
gluster_cli_socket_path = "",
verbose = false,
gluster_host = "",
disabled_volumes = [] of String,
enabled_volumes = [] of String,
disabled_metrics = [] of String,
enabled_metrics = [] of String,
all_metrics = [] of String

property? verbose = false,
disable_volumes_all = false,
disable_all_metrics = false

def initialize
end

Expand All @@ -35,7 +36,7 @@ module GlusterMetricsExporter

def self.set_enabled_metrics
metrics = [] of String
if @@config.disable_all_metrics
if @@config.disable_all_metrics?
# If --disable-all is passed then enabled list
# will only have whatever passed as --enable
# For example --disable-all --enable "volume_status"
Expand Down

0 comments on commit 22afa6b

Please sign in to comment.