Skip to content

Commit 39195cb

Browse files
fix: megalinter fixes for blank space and formatting
1 parent b4724a4 commit 39195cb

File tree

100 files changed

+235
-807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+235
-807
lines changed

docs/build-tool/babashka-task-runner.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ Babashka provides a [task runner](https://book.babashka.org/#tasks) which can be
66

77
[:fontawesome-solid-book-open: Babashka Task Runner](https://book.babashka.org/#tasks)
88

9-
109
<!-- TODO: create tasks to manage a clojure project (as has been done with make) -->

docs/build-tool/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
Build tools can support a wide range of development tasks
44

5-
65
* [GNU make](make.md) - language agnostic build tool, define any tasks
76
* [babashka](babashka.md) - write a built tool using Clojure

docs/build-tool/make.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ A `Makefile` defines targets called via the `make` command. Each target can run
196196

197197
> Practicalli also uses `make` to [configure and build the latest versions of Emacs](https://practical.li/blog/posts/build-emacs-28-on-ubuntu/){target=_blank} and other Linux open source software
198198
199-
200199
## Defining tasks
201200

202201
Create a `Makefile` in the root of a project and define a target by typing a suitable name followed by a `:` character, e.g. `test:`
@@ -211,7 +210,6 @@ repl: ## Run Clojure REPL with rich terminal UI (Rebel Readline)
211210
clojure -M:env/dev:env/test:repl/rebel
212211
```
213212

214-
215213
### Common target naming
216214

217215
Targets used across Practicalli projects follow the [make standard targets for users](https://www.gnu.org/software/make/manual/html_node/Standard-Targets.html)
@@ -232,7 +230,6 @@ Targets used across Practicalli projects follow the [make standard targets for u
232230

233231
[:fontawesome-brands-github: practicalli/dotfiles/Makefile](https://github.com/practicalli/dotfiles/blob/main/Makefile) also defines docker targets to build and compose images locally, inspect images and prune containers and images.
234232

235-
236233
## Target dependencies
237234

238235
A `Makefile` target can depend on either a file name or another target in the `Makefile`.
@@ -247,14 +244,12 @@ Add the filename of a file after the name of the target, to depend on if that fi
247244

248245
Clojure CLI Example: If the `deps` target depends on `deps.edn` and the file has not changed since last run, the deps target will not run again.
249246

250-
251247
## deps target - depend on a file
252248

253249
The deps target would use Clojure CLI or Leiningen to download dependencies.
254250

255251
Configuring the `deps` target to depend on `deps.edn` or `project.clj` file, then if the file has not changed the deps will not run again.
256252

257-
258253
A Clojure CLI example depends on the `deps.edn` file that defines all the library dependencies for the project, tools for testing and packaging the Clojure service. The `-P` flag is the prepare option, a dry run that only downloads the dependencies for the given tasks.
259254

260255
```makefile
@@ -265,7 +260,6 @@ deps: deps.edn ## Prepare dependencies for test and dist targets
265260

266261
> `:env/test` adds libraries to run Kaocha and libraries used to run unit tests. `:package/uberjar` runs a tool that creates an uberjar.
267262

268-
269263
## Clean target - hiding command failure
270264

271265
The clean target should remove files and directories created by the build (compile) process, to ensure a consistent approach to building each time.
@@ -281,7 +275,6 @@ clean:
281275
- rm -rf ./.cpcache
282276
```
283277

284-
285278
## MegaLinter target - simplifying a command
286279

287280
The `lint` target is an example of how the `Makefile` simplifies the command line interface.
@@ -303,7 +296,6 @@ lint-clean:
303296
- rm -rf ./megalinter-reports
304297
```
305298

306-
307299
## Enhancing make output
308300

309301
The `info` message is used with each target to enhances the readability of the make output, especially when multiple targets and commands are involved, or if commands are generating excessive output to standard out.
@@ -316,7 +308,6 @@ The `info` message is used with each target to enhances the readability of the m
316308

317309
![Makefile showing make all output with info messages to separate the Clojure commands and output](https://raw.githubusercontent.com/practicalli/graphic-design/live/clojure/makefile-clojure-make-all-output-with-info.png)
318310

319-
320311
## Avoiding file name collisions
321312

322313
Although unlikely, if a filename in the root of a project has the same name as a `Makefile` target, it can be used instead of running the targets command
@@ -329,7 +320,6 @@ Although unlikely, if a filename in the root of a project has the same name as a
329320

330321
> Reference: [:fontawesome-solid-book-open: Makefile Tutorial: phony](https://makefiletutorial.com/#phony){target=_blank .md-button}
331322

332-
333323
## Halt on failure
334324

335325
`.DELETE_ON_ERROR:` halts any further commands if a command returns non-zero exit status. Useful as short-circuit to stop tasks when further work is not valuable, e.g. if tests fail then it may not be valuable to build the Clojure project.
@@ -341,13 +331,11 @@ all: deps test-ci dist clean
341331

342332
> Reference: [:fontawesome-solid-book-open: Makefile Tutorial: delete_on_error](https://makefiletutorial.com/#delete_on_error){target=_blank .md-button}
343333

344-
345334
## References
346335

347336
[:fontawesome-solid-book-open: Makefile Tutorial by Example](https://makefiletutorial.com/){target=_blank .md-button}
348337
[:fontawesome-brands-github: practicalli/dotfiles Makefile](https://github.com/practicalli/dotfiles/blob/main/Makefile){target=_blank .md-button}
349338

350-
351339
## Summary
352340

353341
A `Makefile` can simplify the command line interface for any task with a Clojure project (or any other language and tooling).

docs/careers/engineering-manager.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Management roles are there to balance the needs of the organisation with the eng
44

55
The role naturally focuses on on the larger goals and challenges facing the engineering teams, supporting the engineers to solve specific challenges using their own skills and experiences (that is why they were hired)
66

7-
87
## Meetings
98

109
[one to one](/engineering-playbook/practices/discussions/one-to-one-meeting.md) are regularly held with direct reports and those people the engineering manager reports to, ensuring there is good working relationship between the respective people.
@@ -18,15 +17,13 @@ Engineering team meetings may occasionally be joined to review how effective the
1817
- [standup](/engineering-playbook/practices/discussions/standup.md) can highlight issues with motivation and team cohesiveness
1918
- [retrospective](/engineering-playbook/practices/discussions/retrospective.md) can help identify action items that the engineering manager can actively support or help direct others to support
2019

21-
2220
!!! HINT "Performance reviews supported by one-to-one meetings"
2321
Where performance reviews are applicable, include the review as an aspect to raise with one-to-one meetings with direct reports throughout the year.
2422

2523
The need to complete a review should be raised as early as possible in one-to-one meetings and regularly raised (even if only briefly) to ensure supporting tasks are carried out to swiftly complete the review at the appropriate time.
2624

2725
Creating regular journal entries can speed up the completion of a self-written performance review submission
2826

29-
3027
## Journal
3128

3229
Write regular journal entries and encourage others to do the same by sharing the journal across the organisation (except for private notes)
@@ -35,7 +32,6 @@ Use the knowledge sharing tool for the organisation, e.g. [Atlassian Confluence]
3532

3633
> TODO: example jornal, e.g. from Billie & 100 days of code
3734
38-
3935
## Management anti-patters
4036

4137
**micro-management** is highly ineffective, demonstrates lack of trust, highlights poor communication and lack of management skills. Shows lack of understanding of the needs of the business and engineering teams.

docs/code-quality/clojure.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Clojure Quality tools
22

3-
43
## Syntax & Idiom check
54

65
[clj-kondo](https://github.com/borkdude/clj-kondo/) is a lint tool that highlights syntactic errors and suggests idioms for Clojure, ClojureScript and EDN.
@@ -12,12 +11,10 @@ clj-kondo can also be used as a command line tool for checking projects in devel
1211
!!! HINT "Clojure LSP includes clj-kondo"
1312
[Clojure LSP install](clojure-lsp/) includes clj-kondo, removing the need for a separate install of clj-kondo
1413

15-
1614
[clj-kondo install guide](https://github.com/borkdude/clj-kondo/blob/master/doc/install.md){target=_blank .md-button}
1715

1816
[Clj-kondo config](https://github.com/clj-kondo/config) contains additional configuration for using clj-kondo with libraries that extend the Clojure language via macros.
1917

20-
2118
### Command Line
2219

2320
Run `clj-kondo` with the --lint option and specify a file or path
@@ -34,7 +31,6 @@ Analyse a project, running the clj-kondo command from the root of the project
3431
clj-kondo --lint .
3532
```
3633

37-
3834
### GitHub workflow
3935

4036
Add clj-kondo linting to continuous integration workflow checks for syntax errors with Clojure files.
@@ -43,7 +39,6 @@ Add clj-kondo linting to continuous integration workflow checks for syntax error
4339
[Clojure Lint & Reviewdog](https://github.com/marketplace/actions/clojure-lint-action){target=_blank .md-button}
4440
[Setup clj-kondo](https://github.com/marketplace/actions/setup-clj-kondo){target=_blank .md-button}
4541

46-
4742
!!! EXAMPLE "Setup Clojure with clj-kondo and cljstyle checks"
4843
```yaml
4944
---
@@ -85,11 +80,9 @@ Add clj-kondo linting to continuous integration workflow checks for syntax error
8580
- run: echo "🍏 Job status is ${{ job.status }}."
8681
```
8782

88-
8983
??? INFO "Setup clojure-lsp Action"
9084
[Setup Clojure-LSP](https://github.com/marketplace/actions/setup-clojure-lsp) contains clj-kondo so can also be used within a continuous integration workflow as well as provide .
9185

92-
9386
## Format Check and Fix
9487

9588
Code is easier to read and work with when it is consistent format that follows common rules.
@@ -102,13 +95,11 @@ A consistent format between editors also minimises version control changes not r
10295
* [cljstyle](https://github.com/greglook/cljstyle){target=_blank} - binary and library (re-write of cljfmt)
10396
* [zprint](https://github.com/kkinnear/zprint){target=_blank} - binary & library
10497

105-
10698
??? INFO "Tooling that uses the Clojure Style Guide"
10799
Emacs `clojure-mode` and Clojure LSP (via cljfmt) format code following the most common Clojure style guide rules, although cljfmt rules are quite strick so Practicalli disables many of them.
108100

109101
cljstyle default configuration follows the majority of styles and has the same defaults as cljfmt. Practicalli Clojure CLI Config tweaks a few rules to make code more readable and allow for repl design experiments.
110102

111-
112103
### cljstyle
113104

114105
Cljstyle is a rewrite of cljfmt, designed to be easier to configure. The default rules implement many of the style rules from the Clojure community style guide and is compatible with cljfmt.
@@ -118,7 +109,6 @@ Call with the `check` option to report formatting issues, providing a coloured d
118109
![Clojure cljstyle format tool - check format diff example](https://raw.githubusercontent.com/practicalli/graphic-design/live/clojure/clojure-cljstyle-check-diff-example-light.png#only-light)
119110
![Clojure cljstyle format tool - check format diff example](https://raw.githubusercontent.com/practicalli/graphic-design/live/clojure/clojure-cljstyle-check-diff-example-dark.png#only-dark)
120111

121-
122112
Call with `fix` option to automatically update all Clojure files with fixes, indicating which files have changed.
123113

124114
Cljstyle will examine all files in the current directory and any sub-directories.
@@ -141,7 +131,6 @@ Cljstyle will examine all files in the current directory and any sub-directories
141131
cljstyle fix
142132
```
143133

144-
145134
=== "Practicalli Clojure CLI Config"
146135
cljstyle can be used as a library without installing the cljstyle binary. [Practicalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) defines the `:format/cljstyle` alias which should be passed wither the `check` or `format` option
147136

@@ -191,7 +180,6 @@ Cljstyle will examine all files in the current directory and any sub-directories
191180
!!! HINT "Stage changes before automatically fixing format"
192181
Practicalli suggests staging (or committing) changes before running `cljstyle fix` to easily undo undesired changes or simply confirm what changes have been made
193182

194-
195183
!!! EXAMPLE "Practicall configuration"
196184
Practicalli updated the default cljstyle configuration with the following changes
197185

@@ -212,7 +200,6 @@ Cljstyle will examine all files in the current directory and any sub-directories
212200
{:enabled? false}
213201
```
214202

215-
216203
### cljfmt
217204

218205
cljfmt is not available as a separate binary, although it a fixed part of the Clojure LSP server implementation.
@@ -236,7 +223,6 @@ Or specify cljfmt configuration within the Clojure LSP configuration file
236223

237224
The default cljfmt rules feel overly strict and Practicalli configuration disables the more draconian rules to make code far more readable
238225

239-
240226
### zprint
241227

242228
zprint is a highly configurable format tool for both Clojure code and Clojure/EDN structures, available as a library and command line tool
@@ -245,7 +231,6 @@ zprint has advanced features over cljstyle and cljfmt, although may require some
245231

246232
[zprint available styles](https://github.com/kkinnear/zprint/blob/main/doc/reference.md#style-and-style-map){target=_blank .md-button}
247233

248-
249234
??? WARNING "No built-in diff option"
250235
zprint requires an external diff tool to see the format changes made, as zprint only reports on the files changed and not the content of those files that has changed.
251236

@@ -288,7 +273,6 @@ zprint has advanced features over cljstyle and cljfmt, although may require some
288273
zprint -lfsw **/*.clj *.edn *.clj
289274
```
290275

291-
292276
=== "Practicalli Clojure CLI Config"
293277
zprint can be used as a library without installing the binary. [Practicalli Clojure CLI Config](/clojure/clojure-cli/practicalli-config/) defines the `:format/zprint` alias which checks the format of a file and reports which files required
294278

@@ -339,7 +323,6 @@ zprint has advanced features over cljstyle and cljfmt, although may require some
339323

340324
`$HOME/.zprintrc` is used for the configuration applied to all files, although this can be overridden in each project (or even as zprint comments in particular files)
341325

342-
343326
[zprint - GitHub repo](https://github.com/kkinnear/zprint){target=_blank .md-button}
344327
[zprint - clojars](https://clojars.org/zprint){target=_blank .md-button}
345328
[zprint - cljdoc](https://cljdoc.org/d/zprint/zprint/1.2.5/doc/introduction){target=_blank .md-button}

docs/code-quality/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ Those same tools can check important quality rules when sharing code via continu
99

1010
The development team should agree on the rules that are valueable for these tools to apply, including those recommended by the community around the programming language or configuration file specification.
1111

12-
1312
## Recommended Tools
1413

1514
MegaLinter provides an extensive range of lint tools all in one, using docker images to remove tool installation requirements.
1615

1716
[MegaLinter - extensive collection of lint tools](megalinter.md){target=_blank .md-button}
1817

19-
2018
[Clojure Quality Tools](clojure.md){target=_blank .md-button}

docs/code-quality/megalinter.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Supported Linters have their own page listing the lint and format tools it provi
1313

1414
MegaLinter run via a GitHub workflow has no requirements
1515

16-
1716
## MegaLinter Locally
1817

1918
The most effective way to manage lint and format issues is to run MegaLinter locally, before pushing changes to a Continuous Integration service.
@@ -24,7 +23,6 @@ Install a recent version of [:globe_with_meridians: Node.js](https://nodejs.org/
2423

2524
> `npx mega-linter-runner` runs MegaLinter without the need for a specific npm install.
2625
27-
2826
### Create a configuration
2927

3028
!!! HINT "Use the Practicalli MegaLinter Configuration"
@@ -69,7 +67,6 @@ Use the `--fix` option with the local MegaLinter runner to automatically apply l
6967
??? HINT "Stage or Commit changes before MegaLinter runner automatic fix"
7068
If code and configuration changes are staged or committed before running with `--fix` then automatic fixes can easily be discarded or treated as a separate commit using any Git tool.
7169

72-
7370
!!! NOTE ""
7471
```shell
7572
npx mega-linter-runner --fix --flavor java --env "'MEGALINTER_CONFIG=.github/config/megalinter.yaml'" --remove-container
@@ -93,24 +90,22 @@ Add a `lint` task to the project Makefile and run `make lint` to call the `mega-
9390
!!! HINT "Options for MegaLinter Runner"
9491
[MegaLinter Runner options](https://megalinter.io/latest/mega-linter-runner/)
9592

96-
9793
## MegaLinter Configuration
9894

9995
Create a configuration file to use with the local `mega-linter-runner` and [GitHub workflow](#github-workflow)
10096

10197
`.github/config/megalinter.yaml` is a recommeded location for the MegaLinter configuration file, especially when using GitHub workflow.
10298

103-
10499
??? EXAMPLE "Practicalli MegaLinter Configuration"
105100
```yaml
106101
---
107102
# Configuration file for MegaLinter
108103
#
109104
# General configuration:
110-
# https://oxsecurity.github.io/megalinter/configuration/
105+
# <https://oxsecurity.github.io/megalinter/configuration/>
111106
#
112107
# Specific Linters:
113-
# https://oxsecurity.github.io/megalinter/latest/supported-linters/
108+
# <https://oxsecurity.github.io/megalinter/latest/supported-linters/>
114109

115110
# ------------------------
116111
# Linters

0 commit comments

Comments
 (0)