-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.exs
More file actions
133 lines (125 loc) · 4.66 KB
/
Copy pathmix.exs
File metadata and controls
133 lines (125 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
defmodule Longbridge.MixProject do
use Mix.Project
def project do
[
app: :longbridge,
version: "0.2.1",
elixir: "~> 1.20",
start_permanent: Mix.env() == :prod,
package: package(),
deps: deps(),
docs: docs(),
aliases: aliases(),
elixirc_paths: elixirc_paths(Mix.env()),
# excoveralls drives the coverage toolchain. Auto-generated protobuf
# modules in lib/longbridge/_protos.ex are excluded via `skip_files`
# in coveralls.json (excoveralls' documented file-exclusion mechanism)
# — the `ignore_modules` key that used to live here was a no-op in
# excoveralls 0.18 (the project config only reads `:tool`).
#
# The 80% coverage bar is enforced by codecov.yml's `status.project`
# check on CI; it is NOT enforced locally — excoveralls' `coveralls.json`
# task does not call `ensure_minimum_coverage/1` (only the local
# `mix coveralls`, `coveralls.html`, and `coveralls.cobertura` tasks do).
# Hand-written modules should each be near 100%; the 0.0% line for
# lib/longbridge/oauth/token_storage.ex is a real gap to fill.
test_coverage: [tool: ExCoveralls],
dialyzer: [
plt_file: {:no_warn, "priv/plts/project.plt"},
flags: [:missing_return, :extra_return, :unmatched_returns]
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[
extra_applications: [:logger, :finch],
mod: {Longbridge.Application, []}
]
end
defp docs do
[
main: "readme",
source_url: "https://github.com/gilbertwong96/longbridge",
homepage_url: "https://github.com/gilbertwong96/longbridge",
extras: ["README.md", "CHANGELOG.md", "LICENSE"],
skip_undefined_reference_warnings_on: [
"README.md",
"CHANGELOG.md",
"lib/longbridge/quote_context.ex",
# References `Longbridge.OAuth.token_path/1` which is @doc false
# (a back-compat shim kept for callers that imported it before
# the public function was moved to FileTokenStorage).
"lib/longbridge/oauth/file_token_storage.ex",
# References `Longbridge.Connection.Session` defdelegates which
# are @doc false (the Session module is internal-only; the
# defdelegate is for clarity in the WSConnection code).
"lib/longbridge/ws_connection.ex",
# References `Longbridge.Application` which is @doc false
# (Application modules are entrypoints, not part of the
# public API).
"lib/longbridge/symbol/store.ex"
]
]
end
def cli do
[preferred_envs: [ci: :test]]
end
defp aliases do
[
ci: [
"compile --all-warnings --warnings-as-errors",
"format --check-formatted",
"credo --strict",
"deps.unlock --check-unused",
"xref graph --label compile-connected --fail-above 0",
"dialyzer",
"ex_dna",
"reach.check --dead-code --smells"
],
# Regenerate the pre-compiled protobuf modules in lib/longbridge/_protos.ex
# from protos/*.proto. Requires `protoc` on $PATH (dev-only).
gen_protos: [
"protox.generate --output-path=lib/longbridge/_protos.ex --include-path=protos protos/control.proto protos/error.proto protos/api.proto protos/subscribe.proto"
]
]
end
defp deps do
[
{:protox, "~> 2.0"},
{:openapi_protobuf_specs,
github: "longbridge/openapi-protobufs",
tag: "gen/go/v0.7.0",
app: false,
compile: false,
only: [:dev, :test]},
{:finch, "~> 0.18"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.18", only: [:dev, :test], runtime: false},
{:ex_dna, "~> 1.5", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.40", only: :dev, runtime: false},
{:ex_slop, "~> 0.4", only: [:dev, :test], runtime: false},
{:mint, "~> 1.9"},
{:mint_web_socket, "~> 1.0"},
{:reach, "~> 2.7", only: [:dev, :test], runtime: false},
{:bandit, "~> 1.8", only: [:dev, :test]}
]
end
defp package do
[
description: """
Elixir SDK for the Longbridge OpenAPI trading platform — real-time
market data, order submission, push subscriptions, and OAuth 2.0
authentication for US, HK, SG, and CN markets.
""",
licenses: ["MIT"],
links: %{
"GitHub" => "https://github.com/gilbertwong96/longbridge",
"Longbridge" => "https://open.longbridge.com"
},
files: ~w[lib protos .formatter.exs mix.exs README.md CHANGELOG.md LICENSE]
]
end
end