Skip to content

Commit 01d8fbf

Browse files
authored
run Runic on codebase and do some basic maintaince (#200)
2 parents ef33e6d + fdf771c commit 01d8fbf

File tree

13 files changed

+594
-497
lines changed

13 files changed

+594
-497
lines changed

.github/workflows/Checks.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Code checks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["master"]
7+
8+
jobs:
9+
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
15+
env:
16+
# Skip runic-pre-commit since we use runic-action below instead
17+
SKIP: runic
18+
19+
runic:
20+
name: "Runic"
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: julia-actions/setup-julia@v2
25+
with:
26+
version: '1.11'
27+
- uses: julia-actions/cache@v2
28+
- uses: fredrikekre/runic-action@v1
29+
with:
30+
version: "1.4" # Keep version in sync with .pre-commit-config.yaml

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
26-
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
26+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
# - id: check-toml # we have tomls with invalid syntax for tests
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: mixed-line-ending
11+
- id: trailing-whitespace
12+
- repo: 'https://github.com/fredrikekre/runic-pre-commit'
13+
rev: v2.0.1
14+
hooks:
15+
- id: runic
16+
additional_dependencies:
17+
- '[email protected]' # Keep version in sync with .github/workflows/Check.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TimerOutputs
22

3-
[![Build Status](https://travis-ci.com/KristofferC/TimerOutputs.jl.svg?branch=master)](https://travis-ci.com/KristofferC/TimerOutputs.jl) [![codecov](https://codecov.io/gh/KristofferC/TimerOutputs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/KristofferC/TimerOutputs.jl)
3+
[![Build Status](https://github.com/KristofferC/TimerOutputs.jl/workflows/CI/badge.svg)](https://github.com/KristofferC/TimerOutputs.jl/actions) [![codecov](https://codecov.io/gh/KristofferC/TimerOutputs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/KristofferC/TimerOutputs.jl)
44

55
`TimerOutputs` is a small Julia package that is used to generate formatted output from timings made in different sections of a program.
66
It's main functionality is the `@timeit` macro, similar to the `@time` macro in Base except one also assigns a label to the code section being timed.

ext/FlameGraphsExt/FlameGraphsExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Use `crop_root = true` to crop the root node to the first and last child nodes.
1616
function FlameGraphs.flamegraph(to::TimerOutput; crop_root = false)
1717
# Skip the very top-level node, which contains no useful data
1818
very_start = crop_root ? min_start_time(to) : to.start_data.time
19-
node_data = _flamegraph_frame(to, very_start; toplevel=true, crop_root)
19+
node_data = _flamegraph_frame(to, very_start; toplevel = true, crop_root)
2020
root = Node(node_data)
2121
return _to_flamegraph(to, root, very_start)
2222
end
@@ -47,7 +47,7 @@ function _flamegraph_frame(to::TimerOutput, start_ns; toplevel = false, crop_roo
4747
tt = Symbol(tt_str)
4848
# Set the pointer to ensure the sf is unique
4949
sf = StackFrame(tt, Symbol("none"), 0, nothing, false, false, Base.objectid(to))
50-
status = 0x0 # "default" status -- See FlameGraphs.jl
50+
status = 0x00 # "default" status -- See FlameGraphs.jl
5151
# TODO: is this supposed to be inclusive or exclusive?
5252
if toplevel
5353
# The root frame covers the total time being measured, so start when the first node
@@ -59,7 +59,7 @@ function _flamegraph_frame(to::TimerOutput, start_ns; toplevel = false, crop_roo
5959
_start = to.start_data.time
6060
_end = to.start_data.time + to.accumulated_data.time
6161
end
62-
range = (Int(_start) : Int(_end)) .- start_ns
62+
range = (Int(_start):Int(_end)) .- start_ns
6363
return FlameGraphs.NodeData(sf, status, range)
6464
end
6565

0 commit comments

Comments
 (0)