diff --git a/CHANGELOG.md b/CHANGELOG.md index e1a65c3..51f7c7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.5.2 + +### Added + +- Added `rubocop:disable all` around generated YARD documentation to prevent RuboCop offenses in the generated code. This ensures that the generated documentation does not cause any issues with RuboCop linting in the project. + ## 1.5.1 ### Added diff --git a/VERSION b/VERSION index 26ca594..4cda8f1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.1 +1.5.2 diff --git a/lib/support_table_data/documentation/source_file.rb b/lib/support_table_data/documentation/source_file.rb index e791c1b..73cdf27 100644 --- a/lib/support_table_data/documentation/source_file.rb +++ b/lib/support_table_data/documentation/source_file.rb @@ -55,9 +55,11 @@ def source_with_yard_docs updated_source = source[0, existing_yard_docs.begin(0)] updated_source << "#{indent}#{BEGIN_YARD_COMMENT}\n" updated_source << "#{indent}#{UPDATE_COMMAND_COMMENT}\n" + updated_source << "#{indent}# rubocop:disable all\n" updated_source << "#{indent}class #{klass.name}\n" if has_class_def updated_source << yard_docs updated_source << "\n#{indent}end" if has_class_def + updated_source << "\n#{indent}# rubocop:enable all" updated_source << "\n#{indent}#{END_YARD_COMMENT}" updated_source << source[existing_yard_docs.end(0)..-1] updated_source @@ -65,9 +67,11 @@ def source_with_yard_docs yard_comments = <<~SOURCE.chomp("\n") #{BEGIN_YARD_COMMENT} #{UPDATE_COMMAND_COMMENT} + # rubocop:disable all class #{klass.name} #{yard_docs.lines.map { |line| line.blank? ? "\n" : " #{line}" }.join} end + # rubocop:enable all #{END_YARD_COMMENT} SOURCE "#{source.rstrip}\n\n#{yard_comments}#{trailing_newline}"