twitter / util

Wonderful reusable code from Twitter
https://twitter.github.io/util
Apache License 2.0
2.69k stars 581 forks source link

fix procedure syntax #215

Closed xuwei-k closed 6 years ago

xuwei-k commented 6 years ago

Problem

procedure syntax is deprecated since Scala 2.13 https://github.com/scala/scala/commit/b5799032760d5aaab5739a41816fb74653bcc82c

Solution

rewrite by scalafix (version 0.6.0-M7) https://scalacenter.github.io/scalafix/docs/rules/ProcedureSyntax

scalafix --rules ProcedureSyntax

Result

There is no semantic changes. source and binary compatible.

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

codecov-io commented 6 years ago

Codecov Report

Merging #215 into develop will increase coverage by 0.02%. The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #215      +/-   ##
==========================================
+ Coverage    59.77%   59.8%   +0.02%     
==========================================
  Files          216     216              
  Lines        10622   10622              
  Branches       883     883              
==========================================
+ Hits          6349    6352       +3     
+ Misses        4273    4270       -3
Impacted Files Coverage Δ
.../src/main/scala/com/twitter/concurrent/Offer.scala 88.23% <ø> (ø) :arrow_up:
...in/scala/com/twitter/util/LastWriteWinsQueue.scala 20.68% <ø> (ø) :arrow_up:
...e/src/main/scala/com/twitter/util/Base64Long.scala 96.15% <ø> (ø) :arrow_up:
.../main/scala/com/twitter/concurrent/Scheduler.scala 74.76% <ø> (ø) :arrow_up:
...rc/main/scala/com/twitter/zk/NativeConnector.scala 0% <ø> (ø) :arrow_up:
.../scala/com/twitter/concurrent/OfferBenchmark.scala 0% <ø> (ø) :arrow_up:
...main/scala/com/twitter/concurrent/Serialized.scala 100% <ø> (ø) :arrow_up:
...e/src/main/scala/com/twitter/util/Disposable.scala 0% <ø> (ø) :arrow_up:
...rk/src/main/scala/com/twitter/jvm/CpuProfile.scala 0% <ø> (ø) :arrow_up:
...ng/src/main/scala/com/twitter/logging/Logger.scala 64.17% <ø> (-0.75%) :arrow_down:
... and 48 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update af41e63...e8ad1b2. Read the comment docs.

xuwei-k commented 6 years ago

There are some ways (e.g. sbt-plugin, wget). I have executed following commands.

  1. install coursier by homebrew https://github.com/coursier/coursier/tree/v1.0.3#command-line
brew install --HEAD coursier/formulas/coursier
  1. create scalafix bootstrap launcher by coursier https://scalacenter.github.io/scalafix/docs/users/installation#coursier
coursier bootstrap ch.epfl.scala:scalafix-cli_2.12.4:0.6.0-M7 -f --main scalafix.v1.Main -o scalafix
  1. execute ./scalafix --rules ProcedureSyntax
yufangong commented 6 years ago

Hi @xuwei-k, thanks for this awesome change. I'm merging it internally now. We also have other repos: Finagle, Finatra, Twitter-Server and Scrooge, if you are interested doing more work like this, those are your candidates :)

yufangong commented 6 years ago

Merged in https://github.com/twitter/util/commit/fe3fda475fbda82770743e4de4522162f6a4f2a9