Skip to content
代码片段 群组 项目
提交 a8d38da5 编辑于 作者: Emerald-Jayde Henao's avatar Emerald-Jayde Henao
浏览文件

Fix Rails/PluralizationGrammar rubocop offenses

上级 04c5d713
No related branches found
No related tags found
无相关合并请求
......@@ -2,12 +2,4 @@
# Cop supports --autocorrect.
Rails/PluralizationGrammar:
Exclude:
- 'app/models/application_setting_implementation.rb'
- 'app/services/packages/helm/extract_file_metadata_service.rb'
- 'app/services/projects/lfs_pointers/lfs_download_service.rb'
- 'app/services/web_hook_service.rb'
- 'db/post_migrate/20240726054350_update_ci_max_total_yaml_size_bytes_default.rb'
- 'ee/app/models/security/finding.rb'
- 'ee/spec/lib/ee/gitlab/git_access_project_spec.rb'
- 'ee/spec/lib/ee/gitlab/pages/deployment_validations_spec.rb'
- 'ee/spec/requests/api/graphql/namespace/projects_spec.rb'
......@@ -136,7 +136,7 @@ def defaults # rubocop:disable Metrics/AbcSize
max_import_remote_file_size: 10240,
max_login_attempts: nil,
max_terraform_state_size_bytes: 0,
max_yaml_size_bytes: 2.megabyte,
max_yaml_size_bytes: 2.megabytes,
max_yaml_depth: 100,
minimum_password_length: DEFAULT_MINIMUM_PASSWORD_LENGTH,
mirror_available: true,
......
......@@ -9,7 +9,7 @@ class ExtractFileMetadataService
# Charts must be smaller than 1M because of the storage limitations of Kubernetes objects.
# based on https://helm.sh/docs/chart_template_guide/accessing_files/
MAX_FILE_SIZE = 1.megabytes.freeze
MAX_FILE_SIZE = 1.megabyte.freeze
def initialize(package_file)
@package_file = package_file
......
......@@ -8,7 +8,7 @@ class LfsDownloadService < BaseService
OidError = Class.new(StandardError)
ResponseError = Class.new(StandardError)
LARGE_FILE_SIZE = 1.megabytes
LARGE_FILE_SIZE = 1.megabyte
attr_reader :lfs_download_object
......
......@@ -35,7 +35,7 @@ def initialize
RESPONSE_BODY_SIZE_LIMIT = 8.kilobytes
# The headers are for debugging purpose. They are displayed on the UI only.
RESPONSE_HEADERS_COUNT_LIMIT = 50
RESPONSE_HEADERS_SIZE_LIMIT = 1.kilobytes
RESPONSE_HEADERS_SIZE_LIMIT = 1.kilobyte
CUSTOM_TEMPLATE_INTERPOLATION_REGEX = /{{(.+?)}}/
......
......@@ -15,7 +15,7 @@ class Finding < ::Gitlab::Database::SecApplicationRecord
include Presentable
include PartitionedTable
MAX_PARTITION_SIZE = 100.gigabyte
MAX_PARTITION_SIZE = 100.gigabytes
ATTRIBUTES_DELEGATED_TO_FINDING_DATA = %i[name description solution location identifiers links false_positive?
assets evidence details remediation_byte_offsets
raw_source_code_extract].freeze
......
......@@ -154,7 +154,7 @@
end
context 'when repository size is above the limit' do
let(:repository_size) { 3.megabyte }
let(:repository_size) { 3.megabytes }
let(:repository_size_limit) { 2.megabytes }
it_behaves_like 'a push to repository over the limit'
......@@ -225,7 +225,7 @@
end
context 'when repository size is above the limit' do
let(:repository_size) { 3.megabyte }
let(:repository_size) { 3.megabytes }
let(:repository_size_limit) { 2.megabytes }
context 'when new change size exceeds the namespace storage limit' do
......
......@@ -13,7 +13,7 @@
instance_double(
::Gitlab::Ci::Build::Artifacts::Metadata::Entry,
entries: [],
total_size: 50.megabyte
total_size: 50.megabytes
)
end
......@@ -52,7 +52,7 @@
context "when size is below the limit" do
before do
allow(metadata_entry).to receive(:total_size).and_return(249.megabyte)
allow(metadata_entry).to receive(:total_size).and_return(249.megabytes)
end
include_examples "valid pages deployment"
......@@ -60,7 +60,7 @@
context "when size is above the limit" do
before do
allow(metadata_entry).to receive(:total_size).and_return(251.megabyte)
allow(metadata_entry).to receive(:total_size).and_return(251.megabytes)
end
include_examples "invalid pages deployment",
......@@ -75,7 +75,7 @@
context "when size is below the limit" do
before do
allow(metadata_entry).to receive(:total_size).and_return(99.megabyte)
allow(metadata_entry).to receive(:total_size).and_return(99.megabytes)
end
include_examples "valid pages deployment"
......@@ -83,7 +83,7 @@
context "when size is above the limit" do
before do
allow(metadata_entry).to receive(:total_size).and_return(101.megabyte)
allow(metadata_entry).to receive(:total_size).and_return(101.megabytes)
end
include_examples "invalid pages deployment",
......
......@@ -32,7 +32,7 @@ def pagination_query(params)
before do
project_4.statistics.update!(lfs_objects_size: 1, repository_size: 4.gigabytes)
project_2.statistics.update!(lfs_objects_size: 1, repository_size: 2.gigabytes)
project_3.statistics.update!(lfs_objects_size: 2, repository_size: 1.gigabytes)
project_3.statistics.update!(lfs_objects_size: 2, repository_size: 1.gigabyte)
end
it_behaves_like 'sorted paginated query' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册