From a53287fce0a90fd307633328d38960736b41cb4c Mon Sep 17 00:00:00 2001 From: OKURA Masafumi Date: Mon, 9 Dec 2024 08:14:14 +0900 Subject: [PATCH] lint: Remove unreachable code (#1137) 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 0276d430a9..a7f9239b62 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 ##