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

Merge toolkit-cleanup into develop #218

Merged
merged 163 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from 156 commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
729ea28
Update CONTRIBUTING.md + rspec & yard default opts
AliSoftware Feb 1, 2021
85656d6
[yard] ios_version_helper
AliSoftware Jan 14, 2021
6aaa05d
Ruby convention for bool-returning methods
AliSoftware Feb 1, 2021
ed58b2d
small renames
AliSoftware Feb 1, 2021
0091bb5
nit refactorings
AliSoftware Feb 1, 2021
229a8d5
Fix @example tags in yard doc
AliSoftware Feb 1, 2021
5d64c7b
Fix @throws -> @raise yard tags
AliSoftware Feb 1, 2021
6fd7b24
yard nit fixes
AliSoftware Feb 1, 2021
635249c
[yard] android_version_helper
AliSoftware Feb 1, 2021
0da5978
[yard] ios_version_helper (nits)
AliSoftware Feb 1, 2021
3296e3d
yardopts @env
AliSoftware Feb 1, 2021
749e7a2
Improve @env documentation
AliSoftware Feb 1, 2021
024d971
[yard] android_version_helper: constants
AliSoftware Feb 1, 2021
05ddd9e
[yard] android_version_helper (finalize)
AliSoftware Feb 1, 2021
e52ec0d
Fix parameter names in screenshots_helpers
AliSoftware Feb 1, 2021
4ccc052
formatting fix
AliSoftware Feb 1, 2021
48b2067
module [Platform]::VersionHelper
AliSoftware Feb 1, 2021
05ab6a6
module Ios::L10nHelper
AliSoftware Feb 1, 2021
f2ffe85
module [Platform]::GitHelper
AliSoftware Feb 1, 2021
aa30ec4
rename module Helpers -> Helper
AliSoftware Feb 1, 2021
2bdd8d6
module Ios::ADCAppSizesHelper
AliSoftware Feb 1, 2021
7a5fa31
android_localize_helper: split `module` tree
AliSoftware Feb 1, 2021
b9c2cad
android_localize_helper: move file
AliSoftware Feb 1, 2021
3b280f9
Fix typos/formatting
AliSoftware Feb 2, 2021
2bc0401
yardopts CRLF at EOF
AliSoftware Feb 2, 2021
0813fe6
abort if PROJECT_ROOT_FOLDER undefined
AliSoftware Feb 2, 2021
263ab3d
Remove constants @group, not really useful
AliSoftware Feb 2, 2021
5d8271a
Merge pull request #198 from wordpress-mobile/yard-doc/step1
AliSoftware Feb 2, 2021
57ca5ca
Merge pull request #199 from wordpress-mobile/yard-doc/step2
AliSoftware Feb 2, 2021
fe447cd
Merge branch 'toolkit-cleanup' into yard-doc/step3
AliSoftware Feb 2, 2021
5891fe3
Merge pull request #200 from wordpress-mobile/yard-doc/step3
AliSoftware Feb 2, 2021
a65adac
git_checkout_and_pull[_release_branch_for]
AliSoftware Feb 4, 2021
6e7ada6
branch_for_hotfix
AliSoftware Feb 4, 2021
f6d3535
tag_and_push
AliSoftware Feb 4, 2021
a4bf563
tag_build
AliSoftware Feb 4, 2021
65e2275
final_tag
AliSoftware Feb 4, 2021
9b1ba06
is_head_on_tag + has_final_tag_for
AliSoftware Feb 4, 2021
15f622d
do_release_branch
AliSoftware Feb 4, 2021
850cf6b
create_branch_for_hotfix -> cut_hotfix_branch
AliSoftware Feb 4, 2021
2bd0cca
check_on_branch
AliSoftware Feb 4, 2021
ad48226
cut_[release|hotfix]_branch -> create_branch
AliSoftware Feb 4, 2021
ba703f7
Android::GitHelper::bump_version_*
AliSoftware Feb 4, 2021
320bc4d
Ios::GitHelper.bump_version_*
AliSoftware Feb 4, 2021
22a8cea
commit_version_bump YARD doc
AliSoftware Feb 4, 2021
7347b54
delete_tags
AliSoftware Feb 4, 2021
289369c
move update_metadata for consistency with iOS
AliSoftware Feb 4, 2021
754d901
Ios::GitHelper.localize_project
AliSoftware Feb 4, 2021
4c82a0d
update_metadata()
AliSoftware Feb 4, 2021
e68f6a1
YARD doc for remaining git_helper methods
AliSoftware Feb 4, 2021
e94273b
YARD doc for Git* modules
AliSoftware Feb 4, 2021
237746d
Typo in YARD comment
AliSoftware Feb 5, 2021
e3264c7
Add todo in *_git_helper methods calling scripts
AliSoftware Feb 9, 2021
34ed934
Merge pull request #206 from wordpress-mobile/cleanup/git-helpers
AliSoftware Feb 9, 2021
b5308c0
Configure rubocop rules and list of violations to fix
AliSoftware Feb 8, 2021
e876196
git ignore .idea (RubyMine files)
AliSoftware Feb 8, 2021
c01f0f7
Rename GHHelperHelper>GithubHelper and GHClient
AliSoftware Feb 8, 2021
1c784b7
Fix rubocop offenses in github_helper.rb
AliSoftware Feb 8, 2021
2d070a6
[rubocop] fix Layout/LeadingCommentSpace
AliSoftware Feb 8, 2021
9cb90ca
[rubocop] fix Layout/SpaceAfterComma
AliSoftware Feb 8, 2021
0652acb
[rubocop] fix Layout/SpaceAroundBlockParameters
AliSoftware Feb 8, 2021
76de887
[rubocop] fix Layout/SpaceAroundKeyword
AliSoftware Feb 8, 2021
d3f121f
[rubocop] fix Layout/SpaceAroundOperators
AliSoftware Feb 8, 2021
651a3d9
[rubocop] fix Layout/SpaceBeforeBlockBraces
AliSoftware Feb 8, 2021
3524996
[rubocop] fix Layout/SpaceInLambdaLiteral
AliSoftware Feb 8, 2021
bb862da
[rubocop] fix Layout/SpaceInsideArrayLiteralBrackets
AliSoftware Feb 8, 2021
3f63ddf
[rubocop] fix Layout/SpaceInsideBlockBraces
AliSoftware Feb 8, 2021
2084482
[rubocop] fix Layout/SpaceInsideHashLiteralBraces
AliSoftware Feb 8, 2021
3047fb8
[rubocop] fix Layout/SpaceInsideParens
AliSoftware Feb 8, 2021
f8f5e19
[rubocop] fix Layout/TrailingBlankLines
AliSoftware Feb 8, 2021
5b7fe81
[rubocop] fix Layout/TrailingWhitespace
AliSoftware Feb 8, 2021
4eb8cb5
[rubocop] fix Style/ColonMethodCall
AliSoftware Feb 8, 2021
e47e1fa
[rubocop] fix Layout/CommentIndentation
AliSoftware Feb 8, 2021
1441c8e
[rubocop] fix Layout/MultilineMethodCallIndentation
AliSoftware Feb 8, 2021
acbf3f8
[rubocop] fix Layout/MultilineMethodCallBraceLayout
AliSoftware Feb 8, 2021
764d779
[rubocop] Re-run --auto-gen-config
AliSoftware Feb 8, 2021
622b99c
Fix gitignore comment
AliSoftware Feb 9, 2021
f6559c4
Move "Style/StringLiterals" to todo rules
AliSoftware Feb 9, 2021
d893cdf
Increase the checkout/fetch depth for Danger action
AliSoftware Feb 9, 2021
89de96c
Merge pull request #207 from wordpress-mobile/rubocop-fixes/step-1
AliSoftware Feb 9, 2021
b1a256f
[rubocop] fix Style/StringLiterals
AliSoftware Feb 11, 2021
15c2400
fix ext/drawText/extconf.rb path constructors
AliSoftware Feb 11, 2021
427db8f
[rubocop] fix Layout/AlignArray
AliSoftware Feb 11, 2021
3cdc4a8
[rubocop] fix Layout/CaseIndentation
AliSoftware Feb 11, 2021
75ef6a6
[rubocop] fix Layout/IndentationConsistency
AliSoftware Feb 11, 2021
53659f7
[rubocop] fix Layout/EmptyLines
AliSoftware Feb 11, 2021
1ffb07a
[rubocop] fix Layout/AlignHash
AliSoftware Feb 11, 2021
85af547
[rubocop] fix Layout/BlockAlignment
AliSoftware Feb 11, 2021
66f3019
[rubocop] fix Layout/IndentationWidth
AliSoftware Feb 11, 2021
4749cfa
[rubocop] fix Layout/IndentFirstArrayElement
AliSoftware Feb 11, 2021
b6eea80
[rubocop] fix Layout/IndentFirstHashElement
AliSoftware Feb 11, 2021
8ef35af
[rubocop] fix Layout/IndentHeredoc
AliSoftware Feb 11, 2021
71c72f6
[rubocop] fix Layout/EndAlignment
AliSoftware Feb 11, 2021
ba0c4fc
[rubocop] fix Layout/Tab
AliSoftware Feb 11, 2021
2fe7b5a
[rubocop] fix Layout/EmptyLineAfterGuardClause
AliSoftware Feb 11, 2021
21926b3
[rubocop] fix Layout/EmptyLinesAroundAccessModifier
AliSoftware Feb 11, 2021
197566f
[rubocop] fix Layout/EmptyLinesAroundArguments
AliSoftware Feb 11, 2021
785275c
[rubocop] fix Layout/EmptyLinesAroundBlockBody
AliSoftware Feb 11, 2021
52df694
[rubocop] fix Layout/EmptyLinesAroundClassBody
AliSoftware Feb 11, 2021
32af96f
[rubocop] fix Layout/EmptyLinesAroundExceptionHandlingKeywords
AliSoftware Feb 11, 2021
a4c7d53
[rubocop] fix Layout/EmptyLinesAroundMethodBody
AliSoftware Feb 11, 2021
7f6558d
[rubocop] fix Layout/EmptyLinesAroundModuleBody
AliSoftware Feb 11, 2021
aad7637
[rubocop] fix Layout/ExtraSpacing
AliSoftware Feb 11, 2021
7ec4c5e
[rubocop] fix Layout/LeadingBlankLines
AliSoftware Feb 11, 2021
a093c06
Merge pull request #210 from wordpress-mobile/cleanup/rubocop/step2
AliSoftware Feb 12, 2021
9ae4e2d
Merge pull request #211 from wordpress-mobile/cleanup/rubocop/step3
AliSoftware Feb 12, 2021
5d91148
[rubocop] fix Lint/AssignmentInCondition
AliSoftware Feb 15, 2021
75a35ea
[rubocop] fix Lint/DeprecatedClassMethods
AliSoftware Feb 15, 2021
9972c26
[rubocop] fix Lint/StringConversionInInterpolation
AliSoftware Feb 15, 2021
19ac40b
[rubocop] fix Lint/UnusedBlockArgument
AliSoftware Feb 15, 2021
86f4f0b
[rubocop] disable Lint/UnusedMethodArgument (manual)
AliSoftware Feb 15, 2021
c748791
[rubocop] fix Lint/ParenthesesAsGroupedExpression (manual)
AliSoftware Feb 15, 2021
3b81d20
[rubocop] fix Lint/ShadowingOuterLocalVariable (manual)
AliSoftware Feb 15, 2021
9a604f2
[rubocop] fix Style/AndOr
AliSoftware Feb 18, 2021
3c24919
[rubocop] fix Style/BarePercentLiterals
AliSoftware Feb 18, 2021
604b017
[rubocop] fix Style/BlockDelimiters
AliSoftware Feb 18, 2021
70c7b6e
[rubocop] fix Style/BracesAroundHashParameters
AliSoftware Feb 18, 2021
75c9583
[rubocop] fix Style/ClassAndModuleChildren
AliSoftware Feb 18, 2021
c3efa66
Merge pull request #213 from wordpress-mobile/cleanup/rubocop/step4
AliSoftware Feb 18, 2021
a9d818d
[rubocop] fix Style/ClassCheck
AliSoftware Feb 18, 2021
3bb7aed
[rubocop] fix Style/ConditionalAssignment
AliSoftware Feb 18, 2021
bfb40c9
[rubocop] fix Style/DefWithParentheses
AliSoftware Feb 18, 2021
bda5e57
[rubocop] fix Style/EmptyLiteral
AliSoftware Feb 18, 2021
2a93320
[rubocop] configure Style/EmptyMethod
AliSoftware Feb 18, 2021
9c77eca
[rubocop] fix Style/Encoding
AliSoftware Feb 18, 2021
9f2c690
[rubocop] fix Style/ExpandPathArguments
AliSoftware Feb 18, 2021
4a56484
[rubocop] fix Style/FormatString
AliSoftware Feb 18, 2021
191e9e5
[rubocop] disable Style/FrozenStringLiteralComment
AliSoftware Feb 18, 2021
5830fc7
[rubocop] fix Style/HashSyntax
AliSoftware Feb 18, 2021
a882be7
[rubocop] fix Style/IfUnlessModifier
AliSoftware Feb 18, 2021
7fe4b1a
[rubocop] fix Style/InverseMethods
AliSoftware Feb 18, 2021
4cb320a
[rubocop] fix Style/ParenthesesAroundCondition
AliSoftware Feb 18, 2021
0250763
[rubocop] fix Style/MultilineIfThen
AliSoftware Feb 18, 2021
3750c49
[rubocop] fix Style/NegatedIf
AliSoftware Feb 18, 2021
0bc24dc
[rubocop] fix Style/NegatedUnless
AliSoftware Feb 18, 2021
79995c3
[rubocop] fix Style/NilComparison
AliSoftware Feb 18, 2021
6de7f59
[rubocop] fix Style/NonNilCheck (safe-auto-correct)
AliSoftware Feb 18, 2021
b7691b6
[rubocop] fix Style/NonNilCheck (manual fixes) ⚠️
AliSoftware Feb 18, 2021
f84285d
[rubocop] ⚠️ Manual fix of Metrics/AbcSize
AliSoftware Feb 18, 2021
27fd9d1
[rubocop] fix Style/Not
AliSoftware Feb 18, 2021
7976a90
[rubocop] fix Style/NumericLiteralPrefix
AliSoftware Feb 18, 2021
9d47d7d
[rubocop] fix Style/PercentLiteralDelimiters
AliSoftware Feb 18, 2021
461eb41
[rubocop] fix Style/RegexpLiteral
AliSoftware Feb 18, 2021
16a9ecb
[rubocop] fix Style/Semicolon
AliSoftware Feb 18, 2021
dc044c3
[rubocop] fix Style/StringLiteralsInInterpolation
AliSoftware Feb 18, 2021
9c5080d
[rubocop] fix Style/TrailingCommaInArguments
AliSoftware Feb 18, 2021
3b6252c
[rubocop] fix Style/TrailingCommaInArrayLiteral
AliSoftware Feb 18, 2021
17b1e76
[rubocop] fix Style/TrailingCommaInHashLiteral
AliSoftware Feb 18, 2021
da50f50
Merge branch 'cleanup/rubocop/step5' into merge-develop-into-cleanup
AliSoftware Feb 18, 2021
4b68f3b
[rubocop] auto-correct new code from develop
AliSoftware Feb 18, 2021
c89d683
[rubocop] fix Metrics/LineLength (in new code from develop)
AliSoftware Feb 18, 2021
fe48a8c
[rubocop] Regen todo config for code from develop
AliSoftware Feb 18, 2021
4492cc7
Add comment about octal notation for chmod-like flags
AliSoftware Feb 24, 2021
f6499f7
[rubocop] fix Style/TrailingCommaInArrayLiteral
AliSoftware Feb 24, 2021
fd8d9bd
build_entries doesn't need the whole config Hash
AliSoftware Feb 24, 2021
6fffd84
Merge pull request #214 from wordpress-mobile/cleanup/rubocop/step5
AliSoftware Feb 24, 2021
74a3982
Merge pull request #215 from wordpress-mobile/merge-develop-into-cleanup
AliSoftware Feb 24, 2021
e9cbc69
[rubocop] disable Style/AsciiComments rule
AliSoftware Feb 24, 2021
d096f63
[rubocop] fix Style/Lambda
AliSoftware Feb 24, 2021
83a4d0d
[rubocop] fix Style/UnneededInterpolation
AliSoftware Feb 24, 2021
ee543ca
[ruboco] run safe-auto-correct + auto-gen-config after rebase
AliSoftware Feb 24, 2021
98af7e7
Remove some extra .to_s calls
AliSoftware Feb 25, 2021
70fb5d5
Provide some rationale for custom Style rules
AliSoftware Feb 25, 2021
228044e
Merge pull request #217 from wordpress-mobile/cleanup/rubocop/6
AliSoftware Feb 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 150

# This action reads the Ruby version from .ruby-version
- uses: ruby/setup-ruby@v1
Expand Down
22 changes: 14 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.DS_Store
/tmp

# JetBrains IDE files
.idea

# Ruby / Bundler
.bundle/
vendor/bundle
Expand All @@ -10,16 +13,19 @@ fastlane/README.md
fastlane/report.xml

# Testing
/test_results
/coverage
test_results/
coverage/

# YARD Documentation
yard-doc/

# DrawText
/lib/drawText
/lib/drawText.bundle
/ext/drawText/drawText.xcodeproj/xcuserdata
/ext/drawText/drawText.xcodeproj/project.xcworkspace/xcuserdata
/ext/drawText/test-output
/default.profraw
lib/drawText
lib/drawText.bundle
ext/drawText/drawText.xcodeproj/xcuserdata
ext/drawText/drawText.xcodeproj/project.xcworkspace/xcuserdata
ext/drawText/test-output
default.profraw

# L10n Linter
vendor/swiftgen
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes for 🎨 !

I think I came across a study (or maybe just an anecdote 🤔 ) on the value of having red for failed and green for passing tests from a psychological point of view. Something like green is calmer so you'll want to get to green fast. Maybe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only issue with this, especially with a distributed company like us, is that colors might have different meanings depending on cultures; especially, in China, red is positive and green is negative (*), so the opposite meaning of what western culture is used to. I wonder if rspec and similar tools take the locale into account and switch those accordingly, but I doubt it. AFAIK we don't have anyone working on this codebase living in China, but still a good anecdote to know about.

(*) that's why, for example, in Apple's Stocks app, if you have your device's locale and region set to China, the colors used for positive vs negative fluctuations are switched compared to a device set in any other region.

--format documentation
59 changes: 57 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,61 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-rspec

Metrics/BlockLength:
########## Lint / CodeStyle

# This gem is included as part of the `Pluginfile`, which is `required` separately,
# so makes it hard to keep it ordered with the rest of the gems
Gemspec/OrderedDependencies:
Exclude:
- 'spec/**/*.rb'
- 'fastlane-plugin-wpmreleasetoolkit.gemspec'

# Especially for actions and methods like `self.run(params)` it's common to have the argument unused; but that
# comes with the parent class API / contract, so we feel it more readable to avoid the _ unused prefix for those.
Lint/UnusedMethodArgument:
Enabled: false

Style/EmptyMethod:
EnforcedStyle: expanded

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma

# Enabling the 'frozen_string_literal: true' comment is nice but should be done with extra care
# because enabling it on code that accidentally mutates string literals will crash at runtime
# (e.g. `name = 'Hello'` then later `name << ' world'` will crash if the comment is enabled)
# So we might enable it at some point, be we will need very careful review that this doesn't break everything.
Style/FrozenStringLiteralComment:
Enabled: false

########## Metrics / Max Lengths Rules

Metrics/LineLength:
Max: 300

Metrics/AbcSize:
Max: 140

Metrics/BlockLength:
Max: 80

Metrics/ClassLength:
Max: 300

Metrics/MethodLength:
Max: 100

Metrics/ModuleLength:
Max: 300

Metrics/ParameterLists:
Max: 10

########## Metrics / Complexity

Metrics/CyclomaticComplexity:
Max: 20

Metrics/PerceivedComplexity:
Max: 20
Loading