Skip to content

Commit 6a29a5d

Browse files
VLanvinfacebook-github-bot
authored andcommitted
Delete standalone mode
Summary: Remove standalone mode, stubs processing, and all dependencies. Reviewed By: ilya-klyuchnikov Differential Revision: D60043866 fbshipit-source-id: 736316c639b6c552450bb3ce2a3700eb2230c672
1 parent 00acde3 commit 6a29a5d

22 files changed

+25
-2711
lines changed

eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Main.scala

+3-14
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@
66

77
package com.whatsapp.eqwalizer
88

9-
import com.whatsapp.eqwalizer.ast.stub.DbApi
109
import com.whatsapp.eqwalizer.util.ELPDiagnostics
1110

1211
object Main {
1312
def main(args: Array[String]): Unit = {
14-
val json = args.contains("--json")
15-
val args1 = args.filterNot(Set("--no-progress", "--json"))
13+
val args1 = args.filterNot(Set("--no-progress"))
1614
if (args1.length == 0) {
1715
help()
1816
return
1917
}
2018

2119
val cmd = args1(0)
22-
require(
23-
!(config.mode == Mode.Standalone && cmd == "ipc"),
24-
s"'ipc' command can only be used by running eqWAlizer through ELP (got command $cmd)",
25-
)
2620

2721
cmd match {
2822
case "ipc" => ipc(args1)
@@ -31,21 +25,16 @@ object Main {
3125
}
3226

3327
def ipc(ipcArgs: Array[String]): Unit = {
34-
if (config.mode == Mode.Standalone) {
35-
throw new IllegalArgumentException(s"eqWAlizer should be called from ELP to use IPC")
36-
}
3728
val modules = ipcArgs.tail
38-
val modulesAndStorages = modules.distinct.flatMap(m => DbApi.getAstStorage(m).map(m -> _))
39-
ELPDiagnostics.getDiagnosticsIpc(modulesAndStorages)
29+
ELPDiagnostics.getDiagnosticsIpc(modules)
4030
}
4131

4232
private def help(): Unit =
4333
Console.print(helpText)
4434

4535
val helpText: String = {
4636
"""com.whatsapp.eqwalizer.Main
47-
|usage:
48-
| check <module_name>
37+
|eqWAlizer is meant to be used from ELP
4938
|""".stripMargin
5039
/* undocumented:
5140
* `stats <module_name>` # stats for powering dashboards

eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Pipeline.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import com.whatsapp.eqwalizer.tc.{Options, PipelineContext, noOptions}
2121
import scala.collection.mutable.ListBuffer
2222

2323
object Pipeline {
24-
def checkForms(astStorage: DbApi.AstStorage, options: Options = noOptions): List[InternalForm] = {
24+
def checkForms(moduleName: String, options: Options = noOptions): List[InternalForm] = {
2525
import scala.collection.mutable.ListBuffer
2626

27-
val forms = Forms.load(astStorage).collect { case f: InternalForm => f }
27+
val forms = Forms.load(moduleName).collect { case f: InternalForm => f }
2828
val module = forms.collectFirst { case Module(m) => m }.get
2929
val erlFile = forms.collectFirst { case File(f, _) => f }.get
3030
val noCheckFuns = forms.collect { case f: EqwalizerNowarnFunction => (f.id, f.pos) }.toMap

eqwalizer/src/main/scala/com/whatsapp/eqwalizer/ast/AutoImport.scala

-183
This file was deleted.

0 commit comments

Comments
 (0)