From 000d3abe9d3bd8c204e3ecc1d917d58ba52967c3 Mon Sep 17 00:00:00 2001 From: OKURA Masafumi Date: Tue, 9 Jul 2024 20:56:51 +0900 Subject: [PATCH] lint: Remove unreachable code This is an attempt to utilize RuboCop further. RuboCop was added in 9262fdd43a3a87403dc095e096f968576cd611d9 but only a few rules have been enabled. I believe we can utilize RuboCop more for better code quality, especially with Lint cops. This is the first step to enable other Lint cops. This commit also exclude some auto generated files. --- .rubocop.yml | 3 +++ lib/rdoc/rdoc.rb | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 63f03e02e3..cfa2405d0c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -17,3 +17,6 @@ Layout/SpaceBeforeComma: Layout/SpaceAfterComma: Enabled: true + +Lint/UnreachableCode: + Enabled: true diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 2da6d9b575..76fd87106b 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -395,7 +395,6 @@ def parse_file filename $stderr.puts e.backtrace.join("\n\t") if $DEBUG_RDOC raise e - nil end ##