Skip to content

Commit 2166098

Browse files
DilumAluthgecodex
andauthored
Add a CI job that runs ExplicitImports, and fix existing implicit imports (#8)
* Make source imports explicit Co-authored-by: Codex <codex@openai.com> * Add ExplicitImports CI check Co-authored-by: Codex <codex@openai.com> --------- Co-authored-by: Codex <codex@openai.com>
1 parent 7393c89 commit 2166098

8 files changed

Lines changed: 55 additions & 11 deletions

File tree

.github/workflows/CI.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,33 @@ jobs:
6060
using WebCacheUtilities
6161
6262
Aqua.test_all(WebCacheUtilities; stale_deps=false, deps_compat=false)
63+
64+
explicit-imports:
65+
name: Julia ${{ matrix.version }} - ExplicitImports
66+
runs-on: ubuntu-latest
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
version:
71+
- '1'
72+
steps:
73+
- uses: actions/checkout@v4
74+
with:
75+
persist-credentials: false
76+
- uses: julia-actions/setup-julia@v2
77+
with:
78+
version: ${{ matrix.version }}
79+
- uses: julia-actions/cache@v2
80+
- name: Run ExplicitImports.jl
81+
shell: julia --color=yes {0}
82+
run: |
83+
import Pkg
84+
Pkg.activate(; temp=true)
85+
Pkg.develop(Pkg.PackageSpec(path=pwd()))
86+
Pkg.add("ExplicitImports")
87+
Pkg.instantiate()
88+
89+
using ExplicitImports
90+
using WebCacheUtilities
91+
92+
check_no_implicit_imports(WebCacheUtilities)

src/CSVAnalysis.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using CSV, DataFrames
1+
using CSV: CSV
2+
using DataFrames: DataFrames, DataFrame
23

34
export parse_csv_source_ips, parse_csv_payload_sizes, parse_csv_http_uri, parse_csv_http_method, parse_csv_http_response_code,
45
attribute_data_to_providers, find_provider
@@ -104,4 +105,4 @@ function attribute_data_to_providers(ip_traffic::Dict, pxs::Dict{String,Vector{<
104105
provider_traffic[find_provider(prefix_dict, ip)] += traffic
105106
end
106107
return provider_traffic
107-
end
108+
end

src/Fastly.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Fastly
2-
using HTTP, JSON
2+
using HTTP: HTTP
3+
using JSON: JSON
34
import ..IPSubnet
45

56
export get_mutable_service_version

src/WebCacheUtilities.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
module WebCacheUtilities
2-
using JSON, HTTP, Sockets
2+
using AbstractTrees: AbstractTrees, PostOrderDFS
3+
using CSV: CSV
4+
using DataFrames: DataFrames, DataFrame
5+
using Dates: DateTime, Hour, Second, TimePeriod
6+
using Gumbo: Gumbo, HTMLElement, parsehtml, tag
7+
using HTTP: HTTP
8+
using JSON: JSON
9+
using Sockets: Sockets, IPAddr, IPv4, IPv6
310

411
include("file_cache.jl")
512
include("IPSubnet.jl")

src/graylog.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using HTTP, Dates, JSON
1+
using CSV: CSV
2+
using DataFrames: DataFrame
3+
using Dates: DateTime, Hour, Second, TimePeriod
4+
using HTTP: HTTP
5+
using JSON: JSON
26

37
export get_graylog_csv, parse_message
48

src/ipinfo.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Gumbo, AbstractTrees
1+
using AbstractTrees: AbstractTrees, PostOrderDFS
2+
using Gumbo: Gumbo, HTMLElement, parsehtml, tag
23

34
function for_each_href(f::Function, html_path::AbstractString)
45
html = parsehtml(String(read(html_path)))
@@ -52,4 +53,4 @@ function dig_cache(domain, record_type="A")
5253
end
5354
end
5455
return readlines(record_file)
55-
end
56+
end

src/providers/AWS.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module AWS
2-
using HTTP, JSON
2+
using JSON: JSON
33
import ..IPSubnet, ..download_to_cache
44

55
prefixes_by_region = Dict{String,Vector{IPSubnet}}()
@@ -35,4 +35,4 @@ function prefix_regions()
3535
return collect(keys(prefixes_by_region))
3636
end
3737

38-
end # AWS
38+
end # AWS

src/providers/Azure.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Azure
2-
using HTTP, JSON, Gumbo, AbstractTrees
2+
using JSON: JSON
33
import ..IPSubnet, ..download_to_cache, ..for_each_href
44

55
prefixes_by_region = Dict{String,Vector{IPSubnet}}()
@@ -48,4 +48,4 @@ function prefix_regions()
4848
return collect(keys(prefixes_by_region))
4949
end
5050

51-
end # module Azure
51+
end # module Azure

0 commit comments

Comments
 (0)