[Fix #6777] Fix a false positive for `Style/TrivialAccessors` by koic · Pull Request #6795 · rubocop-hq/rubocop

Fixes #6777. This PR fixes a false positive for Style/TrivialAccessors when using reader / writer at the top level. The following is a reproduction code. # example.rb def foo @foo end % rubocop e...