Skip to content

Commit 062dd89

Browse files
committed
♻️ Rewrite by OOP
1 parent 31b1e98 commit 062dd89

File tree

6 files changed

+787
-733
lines changed

6 files changed

+787
-733
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,3 @@ repos:
7272
- id: markdownlint-cli2
7373
additional_dependencies:
7474
- markdown-it-texmath
75-
- repo: https://github.com/lunarmodules/luacheck
76-
rev: v1.2.0
77-
hooks:
78-
- id: luacheck

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ $ luarocks --lua-version 5.1 --local --tree ~/.local/share/nvim/rocks install co
6868
## Configure
6969

7070
```lua
71-
require"code-stats".setup({
71+
local CodeStats = require 'code-stats.nvim.codestats'.CodeStats
72+
local codestats = CodeStats {
7273
args = {
7374
headers = {
7475
['X-API-Token'] = "XXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
7576
}
7677
}
77-
})
78+
}
79+
codestats:create_autocmds()
7880
```
7981

8082
For compatibility of
@@ -83,9 +85,11 @@ For compatibility of
8385
also OK:
8486

8587
```lua
86-
require"code-stats".setup({
88+
local CodeStats = require 'code-stats.nvim.codestats'.CodeStats
89+
local codestats = CodeStats {
8790
dotenv = "/the/path/of/codestats.sh"
88-
})
91+
}
92+
codestats:create_autocmds()
8993
```
9094

9195
`/the/path/of/codestats.sh`:

0 commit comments

Comments
 (0)