Skip to content

Graphql/AuthorizeTypes: Add offenses for empty authorize statements

Brian Williams requested to merge bwill/flag-empty-authorize-statements into master

What does this MR do and why?

Describe in detail what your merge request does and why.

An authorize statement with no arguments is the same as not having an authorize statement at all. So, we should flag an offense if authorize does not have any arguments.

Bad

This currently does not result in any offenses.

module Types
  class SomeType < BaseType
    authorize
  end
end

Good

module Types
  class SomeType < BaseType
    authorize :read_code
  end
end

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Brian Williams

Merge request reports

Loading