Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive in SketchupRequirements/RubyCoreNamespace: #154

Open
thomthom opened this issue May 16, 2022 · 1 comment
Open

False positive in SketchupRequirements/RubyCoreNamespace: #154

thomthom opened this issue May 16, 2022 · 1 comment

Comments

@thomthom
Copy link
Member

Analysing extension...
Inspecting 141 files
.........................................................................................................................E...................

Offenses:

[extension-name]/lib/gems/rubyzip/lib/zip/filesystem.rb:628:7: E: SketchupRequirements/RubyCoreNamespace: Do not modify Ruby core functionality. (https://github.com/SketchUp/rubocop-sketchup/tree/main/manual/cops_requirements.md#rubycorenamespace)
      include FileSystem
      ^^^^^^^

141 files inspected, 1 offense detected

The vendored file looks roughly like this:

module ExtensionNamespace
  require 'zip'
  # ...

  module Zip

    module FileSystem
      # ...
    end

    class File
      include FileSystem
    end
  end
end

The cop thinks that File is Ruby's own ::File class while in reality it's ExtensionNamespace::Zip::File.

@thomthom
Copy link
Member Author

This might not be a false positive after all. Need to check how Ruby resolves the File class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant