diff --git a/CHANGELOG.md b/CHANGELOG.md index 41a40acc4..b6911135b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - dev: checkout v4 & python v5 actions in publish-book workflow - dev: sparse checkout scheduled version workflow - dev: upload-artefact v4 & remove explicit token from megalinter +- format: use shell for code blocks, add missing clojure language to code blocks ## Added - button link to Clojure CLI releases changelog to view available versions diff --git a/README.md b/README.md index 955018241..1788266f6 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ Publish book workflow installs Material for MkDocs version 9 Install mkdocs version 9 using the Python pip package manager -```bash +```shell pip install mkdocs-material=="9.*" ``` Install the plugins used by the Practicalli site using Pip (these are also installed in the GitHub Action workflow) -```bash +```shell pip3 install mkdocs-material mkdocs-callouts mkdocs-glightbox mkdocs-git-revision-date-localized-plugin mkdocs-redirects pillow cairosvg ``` @@ -95,20 +95,20 @@ pip3 install mkdocs-material mkdocs-callouts mkdocs-glightbox mkdocs-git-revisio Fork the GitHub repository and clone that fork to your computer, -```bash +```shell git clone https://github.com//.git ``` Run a local server from the root of the cloned project -```bash +```shell make docs ``` The website will open at If making smaller changes, then only rebuild the content that changes, speeding up the local development process -```bash +```shell make docs-changed ``` diff --git a/docs/alternative-tools/clojure-cli/basic-repl.md b/docs/alternative-tools/clojure-cli/basic-repl.md index d4424df85..e32278e0f 100644 --- a/docs/alternative-tools/clojure-cli/basic-repl.md +++ b/docs/alternative-tools/clojure-cli/basic-repl.md @@ -14,7 +14,7 @@ Use `clj` when you want to run a repl (or preferably use [rebel readline](rebel- `clj` command in a terminal window starts a Clojure REPL and shows the version of Clojure used. The command does not need to be in a directory containing a Clojure project. -```bash +```shell clj ``` diff --git a/docs/alternative-tools/clojure-cli/evaluate-an-expression.md b/docs/alternative-tools/clojure-cli/evaluate-an-expression.md index 09c2c6e68..9e0e6892a 100644 --- a/docs/alternative-tools/clojure-cli/evaluate-an-expression.md +++ b/docs/alternative-tools/clojure-cli/evaluate-an-expression.md @@ -12,7 +12,7 @@ This expression calls the `+` function with the arguments `1 2 3 4 5`. As this Using the `-e` option an expression can be passed to the Clojure CLI tools and a value returned -```bash +```shell clojure -e (+ 1 2 3 4 5) ``` diff --git a/docs/alternative-tools/clojure-cli/set-namespace-on-repl-startup.md b/docs/alternative-tools/clojure-cli/set-namespace-on-repl-startup.md index 45900541e..1c9047512 100644 --- a/docs/alternative-tools/clojure-cli/set-namespace-on-repl-startup.md +++ b/docs/alternative-tools/clojure-cli/set-namespace-on-repl-startup.md @@ -11,14 +11,14 @@ Switching to a specific namespace in the REPL allows calling functions by name, To require and switch to a namespace on startup, use the `clojure` or `clj` commands with the --eval option to run the specific commands. The --repl option will ensure the repl starts. -```bash +```shell clj --eval "(require 'practicalli.random-clojure-core-function)" --eval "(in-ns 'practicalli.random-clojure-core-function)" --repl ``` `-r` or `(clojure.main/repl)` are the same as using the `--repl` option -```bash +```shell clj -e "(ns foo.bar) (alter-var-root #'*ns* (constantly 'foo.bar))" -r clj -e "(ns foo.bar) (alter-var-root #'*ns* (constantly 'foo.bar)) (clojure.main/repl)" ``` diff --git a/docs/alternative-tools/data-inspector/reveal.md b/docs/alternative-tools/data-inspector/reveal.md index a520b86c8..44935e5fb 100644 --- a/docs/alternative-tools/data-inspector/reveal.md +++ b/docs/alternative-tools/data-inspector/reveal.md @@ -17,7 +17,7 @@ Use Reveal with a terminal REPL or a Clojure editor that uses nrepl such as Emac Open a terminal and run the command: - ```bash + ```shell clojure -M:inspect/reveal ``` > Use the `clj` command if the `rlwrap` binary is available @@ -105,7 +105,7 @@ Reveal can be used as a `tap>` target with the Rebel REPL, launching the Reveal Start Rebel REPL with Reveal library as a dependency -```bash +```shell clojure -M:repl-reveal:repl/rebel ``` diff --git a/docs/alternative-tools/leiningen/index.md b/docs/alternative-tools/leiningen/index.md index 5ceeb320f..b4d7b0697 100644 --- a/docs/alternative-tools/leiningen/index.md +++ b/docs/alternative-tools/leiningen/index.md @@ -17,7 +17,7 @@ Install the Leiningen tool using the specific instructions for your Operating Sy === "Linux" [Download the lein script](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein) to your local `bin` directory. Then make the `lein` script executable and run `lein` to download the full version. - ```bash + ```shell mkdir ~/bin curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > ~/bin/lein chmod u+x ~/bin/lein @@ -29,7 +29,7 @@ Install the Leiningen tool using the specific instructions for your Operating Sy === "Homebrew" If you have [Homebrew](https://brew.sh/) installed, run the following command in a terminal window. - ```bash + ```shell brew install leiningen ``` @@ -51,7 +51,7 @@ Install the Leiningen tool using the specific instructions for your Operating Sy If you have [Chocolatey](https://chocolatey.org/) installed, add the [Leiningen package](https://chocolatey.org/packages/Lein) by running the following command in a terminal window. - ```bash + ```shell choco install lein ``` @@ -71,7 +71,7 @@ Install the Leiningen tool using the specific instructions for your Operating Sy Check Leiningen is working by running `lein` command in a terminal -```bash +```shell lein help ``` @@ -104,13 +104,13 @@ Leiningen automatically includes the `test` directory when running, so no additi Run all the tests saved to file: -```bash +```shell lein test ``` Run just the unit tests in a specific namepsace. -```bash +```shell lein test :only domain.namespace-test ``` diff --git a/docs/clojure-cli/defining-aliases.md b/docs/clojure-cli/defining-aliases.md index 3761ab69c..05027cecd 100644 --- a/docs/clojure-cli/defining-aliases.md +++ b/docs/clojure-cli/defining-aliases.md @@ -124,7 +124,7 @@ clojure -X:project/run Over-ride the default arguments by passing them on the command line -```bash +```shell clojure -X:project/run '[:http/server :port]' 8888 :log/mulog :console :profile :dev ``` diff --git a/docs/clojure-cli/execution-options.md b/docs/clojure-cli/execution-options.md index bc740db25..b054a024f 100644 --- a/docs/clojure-cli/execution-options.md +++ b/docs/clojure-cli/execution-options.md @@ -46,7 +46,7 @@ The double quotes in an EDN string must be wrapped by single quotes, along with Run a project with the main namespace `practicalli.sudoku-solver`, without any additional aliases on the command line -```bash +```shell clojure -M -m practicalli.sudoku-solver ``` @@ -63,7 +63,7 @@ Adding a `:project/run` alias to the project `deps.edn` file provides a simpler Now the project code can be run using the simple command line form -```bash +```shell clojure -M:project/run ``` @@ -97,7 +97,7 @@ If no -main function is found or the namespace is not specified, then a REPL ses Use the `:repl/rebel` alias with the `-M` execution option -```bash +```shell clojure -M:repl/rebel ``` @@ -109,7 +109,7 @@ Multiple aliases can be specified to include additional paths and libraries. Ali Start a REPL process with this alias -```bash +```shell clojure -M:env/dev:lib/hotload:repl/rebel ``` @@ -120,7 +120,7 @@ The Rebel REPL UI will start, include the dev directory on the class path and th Alises can be used together by chaining their names on the command line -```bash +```shell clojure -M:env/dev:lib/hotload:repl/rebel ``` @@ -139,13 +139,13 @@ Any function on the class path can be called and is passed a hash-map as an argu Call the `status` function from the namespace `practicalli.service`, which is on the classpath in the practicalli.service project -```bash +```shell clojure -X practicalli.service/status ``` Pass arguments to a `start` function in the `practicalli.service` namespace -```bash +```shell clojure -X practicalli.service/start :port 8080 :join? false ``` @@ -170,7 +170,7 @@ The `-T` execution option also uses the `clojure.exec` approach, although the `: Calling Tools on the command line has the general form: -```bash +```shell clojure -Ttool-name function-name :key "value" ,,, ``` @@ -183,7 +183,7 @@ key/value pairs can be passed as arguments to that function (as with the -X exec In this example, the antq tool is installed using the name `antq` -```bash +```shell clojure -Ttools install com.github.liquidz/antq '{:git/tag "1.3.1"}' :as antq ``` @@ -191,19 +191,19 @@ Installing a tool adds an EDN configuration file using the name of the tool in ` Once a tool is installed, run by using the name of the tool. -```bash +```shell clojure -Tantq outdated ``` Options to the tool are passed as key/value pairs (as the tool is called by clojure.exec) -```bash +```shell clojure -Tantq outdated :upgrade true ``` `-Ttools remove` will remove the configuration of the tool of the given name -```bash +```shell clojure -Ttools remove :tool antq ``` @@ -265,13 +265,13 @@ If `:git` or `:local/root` dependencies are defined, the respective code will be Prepare flag by itself download dependencies defined in the `:deps` section of the `deps.edn` file of the current project. -```bash +```shell clojure -P ``` Including one or more aliases will preparing all the dependencies from every alias specified -```bash +```shell clojure -P -M:env/dev:lib/hotload:repl/cider ``` @@ -290,7 +290,7 @@ As prepare is essentially a dry run, then the `clojure` command does not call `: The `:env/dev` alias adds "dev" directory to the class path, [typically used to add a `user.clj` that will automatically load code from the `user` namespace defined in that file](https://practical.li/clojure/clojure-cli/projects/configure-repl-startup.html). -```bash +```shell clojure -A:env/dev ``` @@ -310,7 +310,7 @@ Aliases can be chained together and their configuration will be merged Start a REPL process with this alias -```bash +```shell clojure -A:env/dev:lib/hotload ``` diff --git a/docs/clojure-cli/practicalli-config.md b/docs/clojure-cli/practicalli-config.md index a4712520f..0cb41947e 100644 --- a/docs/clojure-cli/practicalli-config.md +++ b/docs/clojure-cli/practicalli-config.md @@ -89,7 +89,7 @@ All tools are provided via libraries and are only installed on first use. Unuse Run project with or without an alias: -```bash +```shell clojure -M:alias -m domain.app-name clojure -M -m domain.app-name ``` diff --git a/docs/clojure-cli/projects/templates/index.md b/docs/clojure-cli/projects/templates/index.md index b51b98990..a63ac1e93 100644 --- a/docs/clojure-cli/projects/templates/index.md +++ b/docs/clojure-cli/projects/templates/index.md @@ -65,7 +65,7 @@ Create a project using the `:project/create` alias. The `practicalli/minimal` template and `practicalli/playground` name are used if `:template` and `:name` arguments are not specified. -```bash +```shell clojure -T:project/create ``` @@ -78,7 +78,7 @@ Use the form `domain/app-or-lib-name` to specify a project name, typically with Create a project using the `practicalli/application` template and random-function name. -```bash +```shell clojure -T:project/create :template practicalli/application :name practicalli/random-function ``` @@ -87,7 +87,7 @@ clojure -T:project/create :template practicalli/application :name practicalli/ra Change into the directory and test the project runs by starting a REPL with [Terminal REPL](/clojure/clojure-cli/repl/) -```bash +```shell cd playground && clojure -M:repl/rebel ``` @@ -108,7 +108,7 @@ Type code expressions at the repl prompt and press RETURN to evaluate them. Run project with or without an alias: -```bash +```shell clojure -M:alias -m domain.app-name clojure -M -m domain.app-name ``` diff --git a/docs/clojure-cli/repl-startup.md b/docs/clojure-cli/repl-startup.md index 4e62d2fbe..aabb9521a 100644 --- a/docs/clojure-cli/repl-startup.md +++ b/docs/clojure-cli/repl-startup.md @@ -78,7 +78,7 @@ Create an alias to include the `dev` path when running a REPL process Run a Clojure REPL with the `:repl/reloaded` alias (or `:dev/reloaded` `:dev/env`) to add the `dev` directory to the class path and load the code in `dev/user.clj` file into the REPL. -```bash +```shell clojure -M:repl/reloaded ``` @@ -320,7 +320,7 @@ Rather than restart the repl, clojure.tools.namespace.repl provides functions th Start a REPL session using Clojure CLI with `:repl/reloaded`, `dev/reloaded` or `:lib/hotload` aliases -```bash +```shell clojure -M:repl/reloaded ``` diff --git a/docs/clojure-cli/repl/libraries.md b/docs/clojure-cli/repl/libraries.md index bd36868c2..da65e30a9 100644 --- a/docs/clojure-cli/repl/libraries.md +++ b/docs/clojure-cli/repl/libraries.md @@ -35,7 +35,7 @@ Open a terminal and change to the root of the Clojure project directory, where t Start the REPL including the `:database/h2` alias to include every library defined in the `:deps` key and libraries in the `:database/h2` alias. This example is using rebel readline rich terminal UI -```bash +```shell clojure -M:repl/rebel ``` @@ -43,7 +43,7 @@ This command will include Add aliases to include optional libraries, such as those used for development. In this example, the H2 database and next.jdbc libraries are included along with those libraries in the `:deps` key of `deps.edn` -```bash +```shell clojure -M:database/h2:repl/rebel ``` @@ -86,7 +86,7 @@ If errors occur when loading or reloading the namespace with require, the `:verb Start a REPL session using Clojure CLI with the [`:lib/hotload alias`](/clojure/clojure-cli/repl-reloaded/), including rebel readline for an enhance REPL terminal UI. -```bash +```shell clojure -M:lib/hotload:repl/rebel ``` diff --git a/docs/clojure-cli/repl/troubleshooting.md b/docs/clojure-cli/repl/troubleshooting.md index ab4b7c76d..ebb5525dc 100644 --- a/docs/clojure-cli/repl/troubleshooting.md +++ b/docs/clojure-cli/repl/troubleshooting.md @@ -20,7 +20,7 @@ If using a **jack-in** approach with the editor to start the repl, run a termina [Clojure CLI repl - rebel terminal UI](/clojure/clojure-cli/repl/coding/){target=_blank .md-button} -```bash +```shell clojure -M:repl/rebel ``` @@ -68,13 +68,13 @@ If a dependency is not available then a warning should state which library canno Check the extent of the dependencies for the existing project: -```bash +```shell clojure -Stree ``` Use the antq tool to check for a newer version of a dependency -```bash +```shell clojure -T:project/outdated ``` diff --git a/docs/clojure-editors/clojure-lsp/practicalli-snippets.md b/docs/clojure-editors/clojure-lsp/practicalli-snippets.md index 071a0b054..6202a1658 100644 --- a/docs/clojure-editors/clojure-lsp/practicalli-snippets.md +++ b/docs/clojure-editors/clojure-lsp/practicalli-snippets.md @@ -197,7 +197,7 @@ Additionally a Git tag can be specified, enabling the use of the short SHA value A Git client can obtain the short form of a SHA from a Git repository -```bash +```shell git rev-parse --short 1e872b59013425b7c404a91d16119e8452b983f2 ``` diff --git a/docs/clojure-editors/index.md b/docs/clojure-editors/index.md index a688b0a76..6883455a0 100644 --- a/docs/clojure-editors/index.md +++ b/docs/clojure-editors/index.md @@ -41,12 +41,12 @@ SublimeText and IntelliJ are commercial editors (with limited free editions) whi [:fontawesome-brands-github: Practicalli Spacemacs Config](https://github.com/practicalli/spacemacs-config){target=_blank} contains a customised configuration for Clojure development and supporting tools. === "Free Desktop XDG Config" - ```bash + ```shell git clone https://github.com/practicalli/spacemacs.d.git $XDG_CONFIG_HOME/spacemacs` ``` === "Classic Config" - ```bash + ```shell git clone https://github.com/practicalli/spacemacs.d.git $HOME/.spacemacs.d` ``` @@ -76,13 +76,13 @@ SublimeText and IntelliJ are commercial editors (with limited free editions) whi [:fontawesome-brands-github: Practicalli Doom Emacs Config](https://github.com/practicalli/doom-emacs-config){target=_blank} contains a customised configuration for Clojure development and supporting tools. === "Free Desktop XDG Config" - ```bash + ```shell git clone https://github.com/practicalli/doom-emacs-config.git $XDG_CONFIG_HOME/doom` ``` The Practicalli configuration should replace the `~/.config/doom/` directory created by the `doom install` command. === "Classic Config" - ```bash + ```shell git clone https://github.com/practicalli/doom-emacs-config.git $HOME/.doom.d` ``` The Practicalli configuration should replace the `~/.doom.d/` directory created by the `doom install` command. @@ -100,7 +100,7 @@ SublimeText and IntelliJ are commercial editors (with limited free editions) whi === "Ubuntu / Debian" `apt-cache show emacs` to check available versions of Emacs in the Ubuntu package manager. If version 28 is available, install Emacs using the Ubuntu package manager. - ```bash + ```shell sudo apt install emacs ``` @@ -174,7 +174,7 @@ SublimeText and IntelliJ are commercial editors (with limited free editions) whi [Conjure](https://github.com/Olical/conjure) provides Clojure interactive (REPL) development, supporting Clojure CLI, Leiningen and Babashka projects (as well as several other Lisp dialects and interesting languages) Try the Conjure interactive `:ConjureSchool` tutorial which only requires a recent version of neovim - ```bash + ```shell curl -fL conjure.fun/school | sh ``` ![Clojure editors - neovim and conjure tutorial](https://raw.githubusercontent.com/practicalli/graphic-design/live/editors/neovim/screenshots/neovim-conjure-conjure-fun-school-light.png#only-light) diff --git a/docs/clojure-spec/projects/bank-account/index.md b/docs/clojure-spec/projects/bank-account/index.md index b0670e5a7..a1e0b3b06 100644 --- a/docs/clojure-spec/projects/bank-account/index.md +++ b/docs/clojure-spec/projects/bank-account/index.md @@ -10,7 +10,7 @@ A relatively simple bank account application with data and function specificatio Use Clojure CLI and `clj-new` -```bash +```shell clojure -M:new app practicalli/banking-on-clojure ``` diff --git a/docs/clojure-spec/projects/bank-account/rebel-readline.md b/docs/clojure-spec/projects/bank-account/rebel-readline.md index 86252457c..90f783009 100644 --- a/docs/clojure-spec/projects/bank-account/rebel-readline.md +++ b/docs/clojure-spec/projects/bank-account/rebel-readline.md @@ -4,7 +4,7 @@ Start the rebel REPL -```bash +```shell clojure -M:repl/rebel ``` diff --git a/docs/clojure-spec/projects/card-game/index.md b/docs/clojure-spec/projects/card-game/index.md index cdff27b9b..9e32fb814 100644 --- a/docs/clojure-spec/projects/card-game/index.md +++ b/docs/clojure-spec/projects/card-game/index.md @@ -8,7 +8,7 @@ spec generators are used to return varied sample data from those specifications. Create a new Clojure project using `:project/create` from [:fontawesome-solid-book-open: Practicalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) or add an alias definition of your choosing to the Clojure CLI user configuration. -```bash +```shell clojure -T:project/create :template app :name practicalli/card-game ``` diff --git a/docs/coding-challenges/advent-of-code.md b/docs/coding-challenges/advent-of-code.md index a82fc8b83..a98adc171 100644 --- a/docs/coding-challenges/advent-of-code.md +++ b/docs/coding-challenges/advent-of-code.md @@ -28,7 +28,7 @@ A video guide to solving the first challenge of Advent of Code from 2018, trying ## Creating a project for the challenge -```bash +```shell clojure -T:project/create :template lib practicalli.advent-of-clojure-code/2019 ``` diff --git a/docs/coding-challenges/codewars/index.md b/docs/coding-challenges/codewars/index.md index 01088b4f2..02131b3fc 100644 --- a/docs/coding-challenges/codewars/index.md +++ b/docs/coding-challenges/codewars/index.md @@ -22,7 +22,7 @@ Many of the challenges have only a very basic explanation, so always review the The source and test code can be copied into a new project, as has been done with the [practicalli/codewars-guides solutions](https://github.com/practicalli/codewars-guides) -```bash +```shell clojure -M:new lib practicalli/readability-is-king ``` diff --git a/docs/coding-challenges/exercism/bob/bob-string-approach.md b/docs/coding-challenges/exercism/bob/bob-string-approach.md index b3359dc58..106f9742a 100644 --- a/docs/coding-challenges/exercism/bob/bob-string-approach.md +++ b/docs/coding-challenges/exercism/bob/bob-string-approach.md @@ -16,7 +16,6 @@ However if there is whitespace after the question mark then the `last` character ```clojure (= \? (last "this is still a question? ")) - ``` [`clojure.string/trimr`](https://clojuredocs.org/clojure.string/trimr) will remove all the trailing whitespace from the right side of a string. Once trimmed, then our initial comparison code will work again. @@ -31,7 +30,7 @@ Unfortunately the clojure.string API does not have a function to check if a str Convert the string to uppercase -``` +```clojure (clojure.string/upper-case "watch out!") ``` @@ -40,9 +39,9 @@ compare the uppercase version of the string with the original, if they are equal ```clojure (= "WATCH OUT!" (clojure.string/upper-case "WATCH OUT!")) - ``` + ```clojure (= "watch out!" (clojure.string/upper-case "watch out!")) @@ -63,19 +62,19 @@ The [java.lang.Character class](https://docs.oracle.com/en/java/javase/11/docs/a `Character/isLetter` can be called as a function in Clojure, passing in a character type. -``` +```clojure (Character/isLetter \a) ``` To support all Unicode characters there is an isLetter method that takes an integer type. As there could be any kind of characters in the phrase, we will use the int version. This required conversing the character to an int first before calling `Character/isLetter` -``` +```clojure (Character/isLetter (int \a)) ``` the [`some`](https://clojuredocs.org/clojure.core/some) function is used to iterate over all the characters in the phrase. As soon as a letter is found it returns true, so does not need to process the whole phrase unless no letter is found. -``` +```clojure (some #(Character/isLetter (int %)) phrase) ``` @@ -92,7 +91,6 @@ The `cond` expression then evaluates the local names to see if they are true or For the shouting question, the `and` is used to check if two names are both true. ```clojure - (defn response-for [phrase] (let [phrase (string/trimr phrase) silence? (string/blank? phrase) @@ -106,7 +104,6 @@ For the shouting question, the `and` is used to check if two names are both true shouting? "Whoa, chill out!" question? "Sure." :else "Whatever."))) - ``` > The first let binding, `phrase` over-rides the name of the argument to the function. This is not that common an approach as over-riding can lead to confusion. However, in this relatively simple example it feels okay to do. The over-ride is the first let binding and it is preparing the string for all the other let bindings to use. diff --git a/docs/coding-challenges/exercism/bob/index.md b/docs/coding-challenges/exercism/bob/index.md index 11a43c167..7bc8254c2 100644 --- a/docs/coding-challenges/exercism/bob/index.md +++ b/docs/coding-challenges/exercism/bob/index.md @@ -20,7 +20,7 @@ It is important to also read through the supplied unit tests to elaborate on the Download the Bob transcription exercise using the exercism CLI tool -```bash +```shell exercism download --exercise=bob --track=clojure ``` diff --git a/docs/coding-challenges/exercism/index.md b/docs/coding-challenges/exercism/index.md index a8db0940e..438abc673 100644 --- a/docs/coding-challenges/exercism/index.md +++ b/docs/coding-challenges/exercism/index.md @@ -37,7 +37,7 @@ The [:globe_with_meridians: Exercism CLI](https://exercism.org/cli-walkthrough){ ??? HINT "Each challenge shows the download and submit commands" Each Exercise page shows the command to download the code for that specific exercise, which is of the form - ```bash + ```shell exercism download --exercise=exercise-name --track=clojure ``` @@ -57,7 +57,7 @@ Open the project source code downloaded from Exercism in a [:fontawesome-solid-b Once the tests pass and you are happy with the solution, submit it to the Exercism website -```bash +```shell exercism submit /path/to/src-file ``` diff --git a/docs/coding-challenges/exercism/nucleotide-count.md b/docs/coding-challenges/exercism/nucleotide-count.md index 5988dd6d4..d8e184e04 100644 --- a/docs/coding-challenges/exercism/nucleotide-count.md +++ b/docs/coding-challenges/exercism/nucleotide-count.md @@ -29,7 +29,7 @@ Represent a DNA sequence as an ordered collection of nucleotides, e.g. a string Download the Nucleotide Count exercise using the exercism CLI tool !!! NOTE "" - ```bash + ```shell exercism download --exercise=nucleotide-count --track=clojure ``` diff --git a/docs/coding-challenges/exercism/rna-transcription.md b/docs/coding-challenges/exercism/rna-transcription.md index 4fc39d724..7ee660edf 100644 --- a/docs/coding-challenges/exercism/rna-transcription.md +++ b/docs/coding-challenges/exercism/rna-transcription.md @@ -27,7 +27,7 @@ Given a DNA strand, its transcribed RNA strand is formed by replacing each nucle Download the RNA transcription exercise using the exercism CLI tool !!! NOTE "" - ```bash + ```shell exercism download --exercise=rna-transcription --track=clojure ``` diff --git a/docs/coding-challenges/exercism/space-age.md b/docs/coding-challenges/exercism/space-age.md index bb99acf17..de368ef23 100644 --- a/docs/coding-challenges/exercism/space-age.md +++ b/docs/coding-challenges/exercism/space-age.md @@ -13,7 +13,7 @@ Download the RNA transcription exercise using the exercism CLI tool !!! NOTE "" - ```bash + ```shell exercism download --exercise=rna-transcription --track=clojure ``` diff --git a/docs/continuous-integration/circle-ci/random-clojure-function.md b/docs/continuous-integration/circle-ci/random-clojure-function.md index e515e8abd..c010873eb 100644 --- a/docs/continuous-integration/circle-ci/random-clojure-function.md +++ b/docs/continuous-integration/circle-ci/random-clojure-function.md @@ -31,7 +31,7 @@ This guide shows how to develop this project alongside CircleCI as the continuou Start following the guide to create the random clojure function project, using a deps.edn for the Clojure project configuration -```bash +```shell clojure -T:project/new :template app :name practicalli/random-clojure-function ``` @@ -56,7 +56,7 @@ Edit the `deps.edn` file in the root of the project and add a `:test/run` alias, Add the remote repository URL to the local Git repository. -```bash +```shell git remote add practicalli git@github.com:practicalli/random-clojure-function.git ``` diff --git a/docs/games/tictactoe-cli/create-project.md b/docs/games/tictactoe-cli/create-project.md index 61109a2ae..be8d3c742 100644 --- a/docs/games/tictactoe-cli/create-project.md +++ b/docs/games/tictactoe-cli/create-project.md @@ -9,13 +9,13 @@ Create a project for our game. {% content "deps" %} Create a new project using `clj-new` alias, found in [:fontawesome-solid-book-open: Practicalli Clojure CLI Config]({{ book.P9IClojureDepsEdn }}) -```bash +```shell clojure -M:new practicalli/tictactoe-cli ``` Open the project in [a Clojure aware editor](/clojure-editors/) or run a rebel REPL -```bash +```shell clojure -M:repl/rebel ``` @@ -38,7 +38,7 @@ lein new tictactoe-cli > > You can also clone the tictactoe-cli game from GitHub -```bash +```shell git clone https://github.com/practicalli/tictactoe-cli.git ``` diff --git a/docs/install/clojure-cli.md b/docs/install/clojure-cli.md index 16a460e56..d140e4c46 100644 --- a/docs/install/clojure-cli.md +++ b/docs/install/clojure-cli.md @@ -64,12 +64,12 @@ Clojure CLI automatically downloads required library dependencies, including the Use the Homebrew command with the [clojure/tools tap](https://github.com/clojure/homebrew-tools), as defined in the [Clojure.org Getting started guide](https://clojure.org/guides/getting_started#_installation_on_linux) - ```bash + ```shell brew install clojure/tools/clojure ``` Use Homebrew to update an install of Clojure CLI to the latest release - ```bash + ```shell brew upgrade clojure/tools/clojure ``` @@ -83,13 +83,13 @@ Clojure CLI automatically downloads required library dependencies, including the Open "Windows PowerShell" and enter the following commands to configure the shell: - ```bash + ```shell iwr -useb get.scoop.sh | iex Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force ``` Then in the same PowerShell window, install the Clojure related tools using the following commands: - ```bash + ```shell scoop bucket add extras scoop bucket add java scoop bucket add scoop-clojure https://github.com/littleli/scoop-clojure @@ -151,13 +151,13 @@ Fork or clone [:fontawesome-solid-book-open: Practicalli Clojure CLI Config](htt `clojure -Sdescribe` shows the version of Clojure CLI installed and configuration locations used. -```bash +```shell clojure -Sdescribe ``` The output of the command includes the version of Clojure CLI in the `:version` key -```bash +```shell {:version "1.11.1.1386" :config-files ["/usr/local/lib/clojure/deps.edn" "/home/practicalli/.config/clojure/deps.edn" ] :config-user "/home/practicalli/.config/clojure/deps.edn" diff --git a/docs/install/java.md b/docs/install/java.md index a9165a3cc..3b14658a8 100644 --- a/docs/install/java.md +++ b/docs/install/java.md @@ -13,7 +13,7 @@ Check to see if there is an appropriate version of Java already installed. Open a terminal and run the command -```bash +```shell java --version ``` @@ -26,7 +26,7 @@ If Java is installed and on the execution path, the version infomation is return === "Debian Packages" Install Java development kit (JDK) using the `apt` package manager (login as `su -` or prefix the command with `sudo`) - ```bash + ```shell apt install openjdk-21-jdk ``` @@ -42,7 +42,7 @@ If Java is installed and on the execution path, the version infomation is return Install the `openjdk-21-source` package to support navigation of Java Object and Method source code, especially useful when using Java Interoperability from within Clojure code. - ```bash + ```shell sudo apt install openjdk-21-doc openjdk-21-source ``` @@ -51,14 +51,14 @@ If Java is installed and on the execution path, the version infomation is return If `openjdk-21-jdk` package is not available, add the [Ubuntu OpenJDK personal package archive](https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa){target=_blank} !!! NOTE "" - ```bash + ```shell sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update ``` When multiple versions of Java are installed, set the version using the `update-alternatives` command in a terminal !!! NOTE "" - ```bash + ```shell sudo update-alternatives --config java ``` Available java versions will be listed. Enter the list number for the version you wish to use. @@ -67,7 +67,7 @@ If Java is installed and on the execution path, the version infomation is return Using [Homebrew](https://brew.sh/){target=_blank}, run the following command in a terminal to install Java 17: !!! NOTE "" - ```bash + ```shell brew install openjdk@21 ``` @@ -75,12 +75,12 @@ If Java is installed and on the execution path, the version infomation is return More than one version of Java can be installed on MacOSX. Set the Java version by opening a terminal and using one of the following commands Show the Java versions installed - ```bash + ```shell /usr/libexec/java_home -V ``` Switch to Java version 21 - ```bash + ```shell export JAVA_HOME=$(/usr/libexec/java_home -v 21) ``` @@ -93,7 +93,7 @@ If Java is installed and on the execution path, the version infomation is return Follow the [scoop-clojure install instructions](https://github.com/littleli/scoop-clojure){target=_blank}, summarized here: - ```bash + ```shell scoop bucket add java scoop install temurin-lts-jdk ``` @@ -102,7 +102,7 @@ If Java is installed and on the execution path, the version infomation is return If neither Scoop or Windows Subsystem for Linux work, try the [Chocolatey](https://chocolatey.org/){target=_blank} package manager. Install the [Java Runtime (JRE)](https://chocolatey.org/packages/javaruntime){target=_blank} using the following command in a command line window - ```bash + ```shell choco install javaruntime ``` diff --git a/docs/introduction/repl-workflow.md b/docs/introduction/repl-workflow.md index 3f1851131..31583dea1 100644 --- a/docs/introduction/repl-workflow.md +++ b/docs/introduction/repl-workflow.md @@ -182,7 +182,7 @@ Clojure has a number of [:fontawesome-solid-book-open: test runners](https://pra !!! Hint "Automate local test runner" Use [:fontawesome-solid-book-open: kaocha test runner](https://practical.li/clojure/testing/test-runners/kaocha-test-runner/){target=_blank} in watch mode to run tests and specification check automatically (when changes are saved) - ```bash + ```shell clojure -X:test/watch ``` diff --git a/docs/reference/clojure-cli/example-alias-definitions.md b/docs/reference/clojure-cli/example-alias-definitions.md index 597a8ad34..1492e447e 100644 --- a/docs/reference/clojure-cli/example-alias-definitions.md +++ b/docs/reference/clojure-cli/example-alias-definitions.md @@ -46,7 +46,7 @@ The `clj-new` tool can be run using the `-M` flag, passing the template and proj To create a project as an application (to be run via the command line) for the practicalli domain with the application called banking-on-clojure -```bash +```shell clojure -M:new app practicalli/banking-on-clojure ``` @@ -62,7 +62,7 @@ Adding the `:exec-fn` to the `clj-new` alias, the `-X` flag can be used instead Use this alias with the `-X` flag -```bash +```shell clojure -X:project/new :template template-name :name practicalli/banking-on-clojure ``` @@ -117,7 +117,7 @@ Assuming there is an alias called `database/migrate` defined in the project `dep Specific functions from the namespace can be called via the command line -```bash +```shell clojure -X:project/run migrate-db :db-type h2 :database banking-on-clojure clojure -X:project/run server-start :port 8080 ``` @@ -147,7 +147,7 @@ The `-P` flag uses everything from an alias not related to execution. Using `-M` and `-m` works, but seems redundant. Using `-M` by itself runs the REPL. -```bash +```shell clojure -M -m full.namespace.to.dash-main ``` @@ -168,13 +168,13 @@ The simplest form is to define an alias to run the project, specifying just the Then the project can be run using this alias. -```bash +```shell clojure -X:project/run ``` Arguments can be passed to the function as key/value pairs on the command line. -```bash +```shell clojure -X:project/run :port 8080 :host "localhost" ``` @@ -210,7 +210,7 @@ A project `deps.edn` file was created containing the dependency for clojure.java `clojure -m` hello runs the project and returns the time from running the -main function. However this gives a warning: -```bash +```shell WARNING: When invoking clojure.main, use -M ``` diff --git a/docs/reference/clojure-cli/jvm-options.md b/docs/reference/clojure-cli/jvm-options.md index bce4b7aad..1d5fdb71f 100644 --- a/docs/reference/clojure-cli/jvm-options.md +++ b/docs/reference/clojure-cli/jvm-options.md @@ -138,7 +138,7 @@ For systems that require very low latency, use the Z Garbage collector `-Xverify:none` option reduces startup time of the JVM by skipping verification process -```bash +```shell "-Xverify:none" ``` diff --git a/docs/reference/jvm/experimental-options.md b/docs/reference/jvm/experimental-options.md index bdde1563d..8a1095870 100644 --- a/docs/reference/jvm/experimental-options.md +++ b/docs/reference/jvm/experimental-options.md @@ -8,7 +8,7 @@ HotSpot JVM experimental features need to be unlocked by specifying the `-XX:+Un For example, the ZGC garbage collector in JDK 11 can be accessed using -```bash +```shell java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC ``` @@ -20,7 +20,7 @@ java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC Show locks held by `java.util.concurrent` classes in a HotSpot JVM thread dump: -```bash +```shell java -XX:+UnlockExperimentalVMOptions -XX:+PrintConcurrentLocks ``` @@ -34,7 +34,7 @@ These options require you to use the `-XX:+UnlockDiagnosticVMOptions` option be View advance compilation optimisations using the `-XX:+LogCompilation` option: -```bash +```shell java -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation ``` diff --git a/docs/reference/jvm/index.md b/docs/reference/jvm/index.md index 4bd992d2c..f397e5f51 100644 --- a/docs/reference/jvm/index.md +++ b/docs/reference/jvm/index.md @@ -17,7 +17,7 @@ Overview of tools for monitoring and profiling Clojure applications running on t See the environment resources available to the JVM without running a Clojure or Java application: -```bash +```shell java -XshowSettings:system -version ``` @@ -25,7 +25,7 @@ java -XshowSettings:system -version Include `-XshowSettings:system` when running any Java command to provide simple diagnostics, e.g. when running a Clojure Uberjar -```bash +```shell java -XshowSettings:system -jar practicalli-service.jar ``` @@ -51,7 +51,7 @@ Before [CLJS-2377 issue was resolved](https://clojure.atlassian.net/browse/CLJS- At that time, compiling a ClojureScript project without adding the java.xml.bind module would return the error: -```bash +```shell ... Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter diff --git a/docs/reference/jvm/java-17-flags.md b/docs/reference/jvm/java-17-flags.md index 80c572b2c..cfb749b47 100644 --- a/docs/reference/jvm/java-17-flags.md +++ b/docs/reference/jvm/java-17-flags.md @@ -2,7 +2,7 @@ A complete list of all flags available for the JVM, created using the `-XX:+PrintFlagsFinal` option and the results written to a file -```bash +```shell java -XX:+PrintFlagsFinal > java-flags.md ``` diff --git a/docs/reference/jvm/profile-tools.md b/docs/reference/jvm/profile-tools.md index 7a4027824..a2a3f226d 100644 --- a/docs/reference/jvm/profile-tools.md +++ b/docs/reference/jvm/profile-tools.md @@ -16,7 +16,7 @@ Profile applications on the JVM, visualising memory and CPU resources, identifyi === "Ubuntu" Ubuntu / Debian includes VisualVM in the software center - ```bash + ```shell sudo apt install visualvm ``` diff --git a/docs/reference/jvm/understanding-memory-usage.md b/docs/reference/jvm/understanding-memory-usage.md index 4595f1890..87399521a 100644 --- a/docs/reference/jvm/understanding-memory-usage.md +++ b/docs/reference/jvm/understanding-memory-usage.md @@ -9,7 +9,7 @@ Garbage collection cost is in the form of execution pauses while the HotSpot JVM Report a full breakdown of the HotSpot JVM’s memory usage upon exit using the following option combination: !!! EXAMPLE "JVM Memory Usage Report" - ```bash + ```shell -XX:+UnlockDiagnosticVMOptions ‑XX:NativeMemoryTracking=summary ‑XX:+PrintNMTStatistics. ``` diff --git a/docs/simple-projects/data-transformation/most-common-word.md b/docs/simple-projects/data-transformation/most-common-word.md index 0a5f154fe..a4c1ce09f 100644 --- a/docs/simple-projects/data-transformation/most-common-word.md +++ b/docs/simple-projects/data-transformation/most-common-word.md @@ -24,7 +24,7 @@ A suggested approach to find the most common word: [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/common-words ``` @@ -222,6 +222,6 @@ Add a `-main` function that takes a reference for the source of the book and the Now call the code on the command line. -```bash +```shell clojure -m practicalli.common-word "https://www.gutenberg.org/cache/epub/844/pg844.txt" "common-english-words.csv" ``` diff --git a/docs/simple-projects/encode-decode/caesar-cipher-rot13.md b/docs/simple-projects/encode-decode/caesar-cipher-rot13.md index b5386a190..898da60be 100644 --- a/docs/simple-projects/encode-decode/caesar-cipher-rot13.md +++ b/docs/simple-projects/encode-decode/caesar-cipher-rot13.md @@ -10,7 +10,7 @@ A dictionary can be generated to translate between the original alphabet and the [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/caesar-cipher ``` diff --git a/docs/simple-projects/encode-decode/clacks.md b/docs/simple-projects/encode-decode/clacks.md index 36a782e58..f14364844 100644 --- a/docs/simple-projects/encode-decode/clacks.md +++ b/docs/simple-projects/encode-decode/clacks.md @@ -18,7 +18,7 @@ The board game defines the alphabet as a 2 by 3 grid (although in the Discworld [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/clacks-messenger ``` diff --git a/docs/simple-projects/encode-decode/rna-dna.md b/docs/simple-projects/encode-decode/rna-dna.md index 0d086dcc5..c5015ffbf 100644 --- a/docs/simple-projects/encode-decode/rna-dna.md +++ b/docs/simple-projects/encode-decode/rna-dna.md @@ -24,7 +24,7 @@ Given a DNA strand, its transcribed RNA strand is formed by replacing each nucle [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/rna-transcription ``` diff --git a/docs/simple-projects/mutating-state/mutants-assemble.md b/docs/simple-projects/mutating-state/mutants-assemble.md index c1b4b6d37..5b03cbeb1 100644 --- a/docs/simple-projects/mutating-state/mutants-assemble.md +++ b/docs/simple-projects/mutating-state/mutants-assemble.md @@ -13,7 +13,7 @@ We will also introduce the following functions for the first time: [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/mutants-assemble ``` diff --git a/docs/simple-projects/random-clojure-function.md b/docs/simple-projects/random-clojure-function.md index eecc34515..cf06214a2 100644 --- a/docs/simple-projects/random-clojure-function.md +++ b/docs/simple-projects/random-clojure-function.md @@ -25,7 +25,7 @@ A [Live coding video walk-through of this project](https://youtu.be/sXZKrD4cAFk) Use the `:project/create` [:fontawesome-solid-book-open: Practicalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) to create a new Clojure project. -```bash +```shell clojure -T:project/create :template app :name practicalli/random-function ``` @@ -174,14 +174,14 @@ Edit the `src/practicalli/random-function.clj` file. Change the `-main` functio === "Cognitect Test Runner" Run the tests with the Congnitect test runner via the `test` function in the `build.clj` file. - ```bash + ```shell clojure -T:build test ``` === "Kaocha Test Runner" Run the tests with the Kaocha test runner using the alias `:test/run` from [Practicalli Clojure CLI config](/clojure/clojure-cli/practialli-config/) - ```bash + ```shell clojure -M:test/run ``` @@ -189,7 +189,7 @@ Edit the `src/practicalli/random-function.clj` file. Change the `-main` functio Use the clojure command with the main namespace of the application. Clojure will look for the -main function and evaluate it. -```bash +```shell clojure -M -m practicalli.random-function ``` @@ -236,7 +236,7 @@ Run the tests again. If the tests pass, then run the application again -```bash +```shell clojure -M -m practicalli.random-function ``` @@ -385,7 +385,7 @@ Add functionality to list all functions from all namespaces or a specific namesp - + diff --git a/docs/simple-projects/split-the-bill.md b/docs/simple-projects/split-the-bill.md index f0a3ae63a..187c9ede9 100644 --- a/docs/simple-projects/split-the-bill.md +++ b/docs/simple-projects/split-the-bill.md @@ -12,7 +12,7 @@ Start with the simplest possible approach, with everyone paying the same. [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/split-the-bill ``` diff --git a/docs/simple-projects/tdd-kata/recent-song-list.md b/docs/simple-projects/tdd-kata/recent-song-list.md index b859f4406..fe4f7abba 100644 --- a/docs/simple-projects/tdd-kata/recent-song-list.md +++ b/docs/simple-projects/tdd-kata/recent-song-list.md @@ -20,7 +20,7 @@ Optional extras: Create a new project using clj-new -```bash +```shell clojure -T:project/create practicalli/song-list ``` diff --git a/docs/simple-projects/tdd-kata/salary-slip-generator.md b/docs/simple-projects/tdd-kata/salary-slip-generator.md index 320e75f08..f78754750 100644 --- a/docs/simple-projects/tdd-kata/salary-slip-generator.md +++ b/docs/simple-projects/tdd-kata/salary-slip-generator.md @@ -2,7 +2,7 @@ [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/salary-calculator ``` diff --git a/docs/simple-projects/tripple-lock.md b/docs/simple-projects/tripple-lock.md index c40b601e9..430f2941b 100644 --- a/docs/simple-projects/tripple-lock.md +++ b/docs/simple-projects/tripple-lock.md @@ -6,7 +6,7 @@ A new safe too keep all the richest you will gain from becoming a Clojure develo [:fontawesome-solid-book-open: Pracitcalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) provides the `:project/create` alias to create projects using deps-new project. -```bash +```shell clojure -T:project/create :template app :name practicalli/triple-lock ``` diff --git a/docs/testing/test-runners/congnitect-labs-test-runner.md b/docs/testing/test-runners/congnitect-labs-test-runner.md index a79d6d401..25acaec89 100644 --- a/docs/testing/test-runners/congnitect-labs-test-runner.md +++ b/docs/testing/test-runners/congnitect-labs-test-runner.md @@ -27,7 +27,7 @@ Make test-runner available to all projects by adding it to `~/.clojure/deps.edn` Run the Cognitect Labs test runner via the command line -```bash +```shell clojure -M:test/cognitect ``` @@ -51,7 +51,7 @@ A summary is returned with the results of running the tests. Options can be used multiple times in one command, for a logical OR effect. For example, the following command runs all tests in the `practicalli.data.survey` and `practicalli.services.survey-report` namespaces that are found in the `src` and `test` directories -```bash +```shell clojure -M:test/cognitect -d test -d src -n practicalli.data.survey -n practicalli.services.survey-report ``` @@ -67,14 +67,14 @@ Selectively running tests by including and excluding test categories, from the m Use the `--include` flag with the test runner to specify specific categories of tests -```bash +```shell clojure -M:test-runner-cognitect --include :integration ``` The `--include` flag can be used multiple times, defining a test category with each include. -```bash +```shell clojure -M:test-runner-cognitect --include :integration --include :persistence ``` @@ -82,7 +82,7 @@ clojure -M:test-runner-cognitect --include :integration --include :persistence `--exclude` flag runs all tests except those in the given category -```bash +```shell clojure -M:test/cognitect --exclude :integration ``` diff --git a/docs/testing/test-runners/example-projects.md b/docs/testing/test-runners/example-projects.md index ce438e126..6f7d1f031 100644 --- a/docs/testing/test-runners/example-projects.md +++ b/docs/testing/test-runners/example-projects.md @@ -22,7 +22,7 @@ Adding a `test.edn` file is not sufficient for testing this project with lambdai Create a `bin/koacha` script and add the extra alias -```bash +```shell #!/usr/bin/env bash clojure -M:test:test-runner-kaocha "$@" ``` diff --git a/docs/testing/test-runners/kaocha-test-runner.md b/docs/testing/test-runners/kaocha-test-runner.md index b6016dfb9..c7ba54ea8 100644 --- a/docs/testing/test-runners/kaocha-test-runner.md +++ b/docs/testing/test-runners/kaocha-test-runner.md @@ -102,13 +102,13 @@ Kaocha can be run via make tasks, Clojure CLI, or by creating a `kaocha` script. Use the `test-all` target to run all unit tests regardless of failures (execept compiler errors) - ```bash + ```shell make test-all ``` Continually run tests by watching for changes using the `:test/watch` alias. If a test fails, Koacha will stop the test run and restart from the failing test when a change is detected. Use `watch-all` if all tests should run regardless of failure. - ```bash + ```shell make test-watch ``` @@ -126,25 +126,25 @@ Kaocha can be run via make tasks, Clojure CLI, or by creating a `kaocha` script. Pass `:fail-fast? false` as an argument to run all tests regardless of test failure. - ```bash + ```shell clojure -X:test/run :fail-fast? false ``` Continually run tests by watching for changes using the `:test/watch` alias. If a test fails, Koacha will stop the test run and restart from the failing test when a change is detected. - ```bash + ```shell clojure -X:test/watch ``` === "Kaocha script" Kaocha recommends adding a `bin/kaocha` script to each project, although this is optional. The script calls `clojure` with a suitable alias and allows for arguments to be passed to the command using `"$@"`. Command line options will over-ride the same options in the `tests.edn` file. - ```bash title="bin/kaocha" + ```shell title="bin/kaocha" #!/usr/bin/env bash clojure -M:test/runner "$@" ``` Use the `-M` execution option to pass command line flags to the Kaocha test runner. - ```bash + ```shell kaocha --fail-fast ``` @@ -211,7 +211,7 @@ Or add the profile plugin to the `test.edn` configuration - + diff --git a/docs/testing/unit-testing/configure-projects-for-tests.md b/docs/testing/unit-testing/configure-projects-for-tests.md index 31175f1df..1736cb896 100644 --- a/docs/testing/unit-testing/configure-projects-for-tests.md +++ b/docs/testing/unit-testing/configure-projects-for-tests.md @@ -26,13 +26,13 @@ Use an alias to add the `test` directory, either from a user level configuration `:test/run` alias runs all tests from the source code files, called with the `clojure` command in the root of the Clojure project. The alias includes `test` as an extra path and calls the Kaocha test runner. -```bash +```shell clojure -X:test/run ``` Kaocha can also watch for changes saved to file and re-run the tests. -```bash +```shell clojure -X:test/watch ``` @@ -66,7 +66,7 @@ clojure -X:test/cognitect `:test/kaocha` alias unit test runner that also supports Clojure Spec functional tests. the kaocha test runner on the current project. Add a `test.edn` file to configure which tests are run by kaocha. -```bash +```shell clojure -X:test/kaocha ``` diff --git a/docs/testing/unit-testing/test-selectors.md b/docs/testing/unit-testing/test-selectors.md index 62e6aa4d4..7ccd557de 100644 --- a/docs/testing/unit-testing/test-selectors.md +++ b/docs/testing/unit-testing/test-selectors.md @@ -60,7 +60,7 @@ Start a test selective category of tests running by specifying test selectors to Specifying `--skip-meta` on the command line gives the same results - ```bash + ```shell bin/kaocha --skip-meta :metadata-name ```