Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Smilodon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liberty
host
Smilodon
Commits
3b22c71f
Commit
3b22c71f
authored
Dec 03, 2019
by
Yamagishi Kazutoshi
Committed by
Nathan Ladd
Feb 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ESLint and RuboCop in Code Climate (#12534)
parent
ebbe71fd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
6 deletions
+13
-6
.codeclimate.yml
.codeclimate.yml
+2
-2
.rubocop.yml
.rubocop.yml
+6
-0
app/lib/activitypub/adapter.rb
app/lib/activitypub/adapter.rb
+1
-0
app/lib/language_detector.rb
app/lib/language_detector.rb
+1
-1
app/models/media_attachment.rb
app/models/media_attachment.rb
+1
-1
lib/paperclip/lazy_thumbnail.rb
lib/paperclip/lazy_thumbnail.rb
+2
-2
No files found.
.codeclimate.yml
View file @
3b22c71f
...
...
@@ -27,10 +27,10 @@ plugins:
enabled
:
true
eslint
:
enabled
:
true
channel
:
eslint-
5
channel
:
eslint-
6
rubocop
:
enabled
:
true
channel
:
rubocop-0-7
1
channel
:
rubocop-0-7
6
sass-lint
:
enabled
:
true
exclude_patterns
:
...
...
.rubocop.yml
View file @
3b22c71f
...
...
@@ -71,6 +71,9 @@ Naming/MemoizedInstanceVariableName:
Rails
:
Enabled
:
true
Rails/EnumHash
:
Enabled
:
false
Rails/HasAndBelongsToMany
:
Enabled
:
false
...
...
@@ -102,6 +105,9 @@ Style/Documentation:
Style/DoubleNegation
:
Enabled
:
true
Style/FormatStringToken
:
Enabled
:
false
Style/FrozenStringLiteralComment
:
Enabled
:
true
...
...
app/lib/activitypub/adapter.rb
View file @
3b22c71f
...
...
@@ -35,6 +35,7 @@ class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base
def
serializable_hash
(
options
=
nil
)
named_contexts
=
{}
context_extensions
=
{}
options
=
serialization_options
(
options
)
serialized_hash
=
serializer
.
serializable_hash
(
options
.
merge
(
named_contexts:
named_contexts
,
context_extensions:
context_extensions
))
serialized_hash
=
serialized_hash
.
select
{
|
k
,
_
|
options
[
:fields
].
include?
(
k
)
}
if
options
[
:fields
]
...
...
app/lib/language_detector.rb
View file @
3b22c71f
...
...
@@ -44,7 +44,7 @@ class LanguageDetector
words
=
text
.
scan
(
RELIABLE_CHARACTERS_RE
)
if
words
.
present?
words
.
reduce
(
0
)
{
|
acc
,
elem
|
acc
+
elem
.
size
}.
to_f
/
text
.
size
.
to_f
>
0.3
words
.
reduce
(
0
)
{
|
acc
,
elem
|
acc
+
elem
.
size
}.
to_f
/
text
.
size
>
0.3
else
false
end
...
...
app/models/media_attachment.rb
View file @
3b22c71f
...
...
@@ -287,7 +287,7 @@ class MediaAttachment < ApplicationRecord
width:
width
,
height:
height
,
size:
"
#{
width
}
x
#{
height
}
"
,
aspect:
width
.
to_f
/
height
.
to_f
,
aspect:
width
.
to_f
/
height
,
}
end
...
...
lib/paperclip/lazy_thumbnail.rb
View file @
3b22c71f
...
...
@@ -9,8 +9,8 @@ module Paperclip
min_side
=
[
@current_geometry
.
width
,
@current_geometry
.
height
].
min
.
to_i
options
[
:geometry
]
=
"
#{
min_side
}
x
#{
min_side
}
#"
if
@target_geometry
.
square?
&&
min_side
<
@target_geometry
.
width
elsif
options
[
:pixels
]
width
=
Math
.
sqrt
(
options
[
:pixels
]
*
(
@current_geometry
.
width
.
to_f
/
@current_geometry
.
height
.
to_f
)).
round
.
to_i
height
=
Math
.
sqrt
(
options
[
:pixels
]
*
(
@current_geometry
.
height
.
to_f
/
@current_geometry
.
width
.
to_f
)).
round
.
to_i
width
=
Math
.
sqrt
(
options
[
:pixels
]
*
(
@current_geometry
.
width
.
to_f
/
@current_geometry
.
height
)).
round
.
to_i
height
=
Math
.
sqrt
(
options
[
:pixels
]
*
(
@current_geometry
.
height
.
to_f
/
@current_geometry
.
width
)).
round
.
to_i
options
[
:geometry
]
=
"
#{
width
}
x
#{
height
}
>"
end
...
...
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