Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0a2d8a35
Commit
0a2d8a35
authored
May 03, 2021
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore rubocop in base_enum type
parent
05c87a33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-1
app/graphql/types/base_enum.rb
app/graphql/types/base_enum.rb
+4
-0
No files found.
.rubocop_manual_todo.yml
View file @
0a2d8a35
...
...
@@ -13,7 +13,6 @@
# WIP See https://gitlab.com/gitlab-org/gitlab/-/issues/322903
Graphql/Descriptions
:
Exclude
:
-
'
app/graphql/types/base_enum.rb'
-
'
app/graphql/types/container_expiration_policy_cadence_enum.rb'
-
'
app/graphql/types/container_expiration_policy_keep_enum.rb'
-
'
app/graphql/types/container_expiration_policy_older_than_enum.rb'
...
...
app/graphql/types/base_enum.rb
View file @
0a2d8a35
...
...
@@ -17,6 +17,9 @@ module Types
# declarative_enum MyDeclarativeEnum
# end
#
# Disabling descriptions rubocop for a false positive here
# rubocop: disable Graphql/Descriptions
#
def
declarative_enum
(
enum_mod
,
use_name:
true
,
use_description:
true
)
graphql_name
(
enum_mod
.
name
)
if
use_name
description
(
enum_mod
.
description
)
if
use_description
...
...
@@ -25,6 +28,7 @@ module Types
value
(
key
.
to_s
.
upcase
,
**
content
)
end
end
# rubocop: enable Graphql/Descriptions
# Helper to define an enum member for each element of a Rails AR enum
def
from_rails_enum
(
enum
,
description
:)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment