Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1
1.5.2
4 changes: 4 additions & 0 deletions lib/support_table_data/documentation/source_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,23 @@ 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
else
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}"
Expand Down