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

FEATURE: Add cops for plugins #41

Merged
merged 1 commit into from
Feb 28, 2024
Merged

FEATURE: Add cops for plugins #41

merged 1 commit into from
Feb 28, 2024

Commits on Feb 28, 2024

  1. FEATURE: Add cops for plugins

    This patch adds some new rules to have saner defaults for our plugins.
    These rules should help in particular with disabled plugins.
    
    The new cops are:
    
    * Discourse/Plugins/CallRequiresPlugin: checks `requires_plugin` is
      called in controllers.
    * Discourse/Plugins/DiscourseEvent: checks `on` is called instead of
      `DiscourseEvent.on`.
    * Discourse/Plugins/NamespaceConstants: checks constants are not defined
      outside the plugin namespace.
    * Discourse/Plugins/NamespaceMethods: checks methods are not defined
      outside the plugin namespace.
    * Discourse/Plugins/NoMonkeyPatching: checks existing classes are not
      patched in `plugin.rb` using `class_eval`.
    * Discourse/Plugins/UseRequireRelative: checks `load` is not used to
      load dependencies.
    Flink committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    0b1e14b View commit details
    Browse the repository at this point in the history