Skip to content

Commit 064fb48

Browse files
authored
Merge pull request #138 from clj-commons/hls/20250613-tweaks
Adjust the default-frame-rules
2 parents 4187dbe + 6517dd5 commit 064fb48

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

.github/workflows/clojure.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
uses: actions/checkout@v4
1919

2020
- name: Setup Java
21-
uses: actions/[email protected].0
21+
uses: actions/[email protected].1
2222
with:
2323
java-version: '11'
2424
distribution: 'corretto'
2525

2626
- name: Install clojure tools
27-
uses: DeLaGuardo/setup-clojure@13.2
27+
uses: DeLaGuardo/setup-clojure@13.4
2828
with:
29-
cli: 1.12.0.1530
29+
cli: 1.12.1.1550
3030

3131
- name: Cache clojure dependencies
3232
uses: actions/cache@v4

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
- New `miniminal-style` for table output that uses only spaces to separate columns
1111
- New :title-align and :align keys for columns to be used instead of :title-pad and :pad (support for which may be removed in the future)
1212
- Table styles now include a :divider? key which, if true, enables the divider between the title line and the first row of data (previously, the divider was not optional)
13+
- `clj-commons.format.exceptions`
14+
- `default-frame-rules` was changed to add default rules (to further limit clutter in exceptions reports)
15+
- omit `clojure.core/apply` and `clojure.core/with-bindings*`
16+
- omit several functions in `clojure.test`
17+
1318

1419
## 3.3.2 - 28 Mar 2025
1520

deps.edn

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{:paths ["src"]
2-
:deps {org.clojure/clojure {:mvn/version "1.12.0"}}
2+
:deps {org.clojure/clojure {:mvn/version "1.12.1"}}
33

44
:aliases
55
{:test
66
;; clj -X:test
77
{:extra-paths ["test"]
88
:extra-deps {criterium/criterium {:mvn/version "0.4.6"}
9-
org.clojure/core.async {:mvn/version "1.7.701"}
9+
org.clojure/core.async {:mvn/version "1.8.741"}
1010
nubank/matcher-combinators {:mvn/version "3.9.1"}
11-
io.github.tonsky/clj-reload {:mvn/version "0.9.4"}
11+
io.github.tonsky/clj-reload {:mvn/version "0.9.7"}
1212
io.github.cognitect-labs/test-runner {:git/tag "v0.5.1"
1313
:git/sha "dfb30dd"}}
1414
:jvm-opts ["-Dclj-commons.ansi.enabled=true"]
@@ -21,10 +21,10 @@
2121
:ns-default build}
2222

2323
:1.11
24-
{:override-deps {org.clojure/clojure {:mvn/version "1.11.4"}}}
24+
{:override-deps {org.clojure/clojure {:mvn/version "1.12.1"}}}
2525

2626
:1.10
27-
{:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}}
27+
{:override-deps {org.clojure/clojure {:mvn/version "1.12.1"}}}
2828

2929
;; clj -M:test:demo
3030
:demo
@@ -36,7 +36,7 @@
3636
;; clj -M:lint
3737

3838
:lint
39-
{:deps {clj-kondo/clj-kondo {:mvn/version "2025.02.20"}}
39+
{:deps {clj-kondo/clj-kondo {:mvn/version "2025.06.05"}}
4040
:main-opts ["-m" "clj-kondo.main" "--lint" "src"]}
4141

4242
:nrepl

src/clj_commons/format/exceptions.clj

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(:require [clojure.pprint :as pp]
44
[clojure.set :as set]
55
[clojure.string :as str]
6-
[clj-commons.ansi :refer [compose]]
6+
[clj-commons.ansi :refer [compose perr]]
77
[clj-commons.pretty-impl :refer [padding]])
88
(:refer-clojure :exclude [*print-level* *print-length*])
99
(:import (java.lang StringBuilder StackTraceElement)
@@ -115,18 +115,22 @@
115115
116116
The default rules:
117117
118-
* omit everything in `clojure.lang`, `java.lang.reflect`, and the function `clojure.core/apply`
118+
* omit everything in `clojure.lang`, `java.lang.reflect`
119+
* omit `clojure.core/with-bindings*` and `clojure.core/apply`
119120
* hide everything in `sun.reflect`
121+
* omit a number of functions in `clojure.test`
120122
* terminate at `speclj.*`, `clojure.main/main*`, `clojure.main/repl/read-eval-print`, or `nrepl.middleware.interruptible-eval`
121123
"
122124
[[:package "clojure.lang" :omit]
125+
[:name "clojure.core/with-bindings*" :omit]
123126
[:package #"sun\.reflect.*" :hide]
124127
[:package "java.lang.reflect" :omit]
125128
[:name #"speclj\..*" :terminate]
126129
[:name "clojure.core/apply" :omit]
127130
[:name #"nrepl\.middleware\.interruptible-eval/.*" :terminate]
128131
[:name #"clojure\.main/repl/read-eval-print.*" :terminate]
129-
[:name #"clojure\.main/main.*" :terminate]])
132+
[:name #"clojure\.main/main.*" :terminate]
133+
[:name #"\Qclojure.test/\E(test-ns|test-all-vars|default-fixture).*" :omit]])
130134

131135
(def ^{:added "0.1.18"
132136
:dynamic true}
@@ -312,12 +316,11 @@
312316

313317
(def ^:private stack-trace-warning
314318
(delay
315-
(binding [*out* *err*]
316-
(println (compose
317-
[:bright-yellow "WARNING: "]
318-
"Stack trace of root exception is empty; this is likely due to a JVM optimization that can be disabled with "
319-
[:bold "-XX:-OmitStackTraceInFastThrow"] "."))
320-
(flush))))
319+
(perr
320+
[:bright-yellow "WARNING: "]
321+
"Stack trace of root exception is empty; this is likely due to a JVM optimization that can be disabled with "
322+
[:bold "-XX:-OmitStackTraceInFastThrow"] ".")
323+
(flush)))
321324

322325
(defn transform-stack-trace
323326
"Transforms a seq of StackTraceElement objects into a seq of stack frame maps:

test/demo.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(:require
33
[clj-commons.pretty.repl :as repl]
44
[clj-commons.format.exceptions :as e]
5-
[clj-commons.ansi :refer [compose pcompose pout]]
5+
[clj-commons.ansi :refer [compose pout]]
66
[clj-commons.format.binary :as b]
77
[clojure.java.io :as io]
88
[clojure.repl :refer [pst]]
@@ -36,7 +36,7 @@
3636
"Creates a sample exception used to test the exception formatting logic."
3737
[]
3838
(try
39-
(update-row)
39+
(apply update-row [])
4040
(catch Throwable e
4141
;; Return it, not rethrow it.
4242
(RuntimeException. "Request handling exception" e))))
@@ -71,7 +71,7 @@
7171
(println "Clojure version: " *clojure-version*)
7272
(println "Installing pretty exceptions ...")
7373
(repl/install-pretty-exceptions)
74-
(pcompose [:bold.green "ok"])
74+
(pout [:bold.green "ok"])
7575
(pst (make-exception))
7676
(println "\nTesting reporting of repeats:")
7777
(try (countdown 20)

0 commit comments

Comments
 (0)