Skip to content

Commit 365b602

Browse files
committed
docs: 📝 Update
1 parent 597f426 commit 365b602

File tree

5 files changed

+49
-1
lines changed

5 files changed

+49
-1
lines changed

docs/assets/badge-100.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/assets/badge-88.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

docs/getting-started/development-workflow.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,51 @@ jobs:
4141
uses: getcodelimit/codelimit-action@v1
4242
```
4343

44+
### Status badge
45+
46+
A status badge is stored after each run in the `_codelimit_reports` branch of
47+
the repository.
48+
49+
To get the Markdown for the badge run the CodeLimit CLI in a local checkout of
50+
the repository, for example:
51+
52+
```shell
53+
54+
$ codelimit badge
55+
[![CodeLimit](https://github.com/getcodelimit/codelimit/blob/_codelimit_reports/
56+
main/badge.svg)](https://github.com/getcodelimit/codelimit/blob/_codelimit_repor
57+
ts/main/codelimit.md)
58+
59+
✔ Badge Markdown copied to clipboard!
60+
```
61+
62+
#### Meaning of the badge
63+
64+
If a repository contains functions that *exceed 60 lines of code*, the badge
65+
will show:
66+
67+
<div align="center">
68+
<img src="../../../assets/badge-needs-refactoring.svg" alt="Badge needs refactoring" class="off-glb">
69+
</div>
70+
71+
If a repository contains *no functions that exceed 30 lines of code*, the badge
72+
will show:
73+
74+
<div align="center">
75+
<img src="../../../assets/badge-100.svg" alt="Badge needs refactoring" class="off-glb">
76+
</div>
77+
78+
Otherwise, the badge will show the percentage of code that does not exceed 30
79+
lines of code.
80+
81+
If that percentage is 80% or higher, the badge will be green:
82+
83+
<div align="center">
84+
<img src="../../../assets/badge-88.svg" alt="Badge needs refactoring" class="off-glb">
85+
</div>
86+
87+
If that percentage is below 80%, the badge will be orange.
88+
4489
## Pre-commit hook
4590

4691
CodeLimit can be installed as a [pre-commit](https://pre-commit.com/) hook so

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ markdown_extensions:
3838
- pymdownx.snippets
3939
nav:
4040
- CodeLimit: 'index.md'
41-
- 'why-function-length.md'
4241
- Getting Started:
4342
- 'getting-started/development-workflow.md'
4443
- 'getting-started/standalone-usage.md'
4544
- 'configuration.md'
45+
- 'why-function-length.md'
4646
- 'faq.md'
4747
- 'development.md'

0 commit comments

Comments
 (0)