Skip to content

Commit 0e90b8b

Browse files
authored
Merge pull request #5 from Dich0tomy/feat/add-collaborators-consistency-config
Feat/add collaborators consistency config
2 parents 2ccb993 + 948a4bd commit 0e90b8b

File tree

13 files changed

+152
-62
lines changed

13 files changed

+152
-62
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = tab
7+
indent_width = 2
8+
charset = utf-8
9+
10+
[*.{nix,yaml,yml}]
11+
indent_style = spaces
12+
indent_width = 2

.github/workflows/lua-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Run tests
23
on:
34
pull_request:

.github/workflows/luarocks.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Push to Luarocks
23

34
on:
@@ -8,11 +9,11 @@ on:
89
workflow_dispatch:
910

1011
jobs:
11-
# luarocks-upload:
12-
# runs-on: ubuntu-22.04
13-
# steps:
14-
# - uses: actions/checkout@v3
15-
# - name: LuaRocks Upload
16-
# uses: nvim-neorocks/luarocks-tag-release@v5
17-
# env:
18-
# LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
12+
luarocks-upload:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v3
16+
# - name: LuaRocks Upload
17+
# uses: nvim-neorocks/luarocks-tag-release@v5
18+
# env:
19+
# LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}

.github/workflows/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Release Please
23

34
on:

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
/*
22

3-
#GH, git
3+
# GH, git
44
!.gitignore
55
!.github/
66

77
# Meta
88
!LICENSE
99
!TODO.md
1010

11+
# Collaborators consistency
12+
!.editorconfig
13+
!stylua.toml
14+
!.pre-commit-config.yaml
15+
!git-conventional-commits.yaml
16+
1117
# Nix
1218
!nix/
1319
!default.nix

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# See https://pre-commit.com for more information
3+
# See https://pre-commit.com/hooks.html for more hooks
4+
repos:
5+
- repo: https://github.com/rhysd/actionlint
6+
rev: v1.7.1
7+
hooks:
8+
- id: actionlint
9+
10+
- repo: https://github.com/adrienverge/yamllint.git
11+
rev: v1.35.1
12+
hooks:
13+
- id: yamllint
14+
15+
- repo: https://github.com/crate-ci/typos
16+
rev: v1.23.2
17+
hooks:
18+
- id: typos
19+
20+
- repo: https://github.com/qoomon/git-conventional-commits
21+
rev: v2.6.7
22+
hooks:
23+
- id: conventional-commits
24+
25+
- repo: https://github.com/JohnnyMorganz/StyLua
26+
rev: v0.20.0
27+
hooks:
28+
- id: stylua-github

docs/tips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ mkShell {
105105

106106
This is due to the fact that these are guarded by special "feature test macros" of form `__cpp_lib_x`, `__cpp_has_x`, etc.
107107

108-
If you already have `clangd` configured you can go to defintion on the header. It should be guarded by something akin to this:
108+
If you already have `clangd` configured you can go to definition on the header. It should be guarded by something akin to this:
109109
```cpp
110110
#if __cplusplus > 202002L && __cpp_concepts >= 202002L
111111
```

git-conventional-commits.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
convention:
3+
commitTypes:
4+
- feat
5+
- fix
6+
- perf
7+
- ref
8+
- style
9+
- test
10+
- build
11+
- docs
12+
- env
13+
- chore
14+
releaseTagGlobPattern: v?[0-9]*.[0-9]*.[0-9]*

lua/cpp-tools/lib/iter.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ function M.line_count(str)
99
for i = 1, length - 1 do
1010
local c = str:sub(i, i)
1111
if c == '\n' then
12-
if (i ~= (length - 2)) then
13-
count = count + 1
14-
end
15-
end
12+
if i ~= (length - 2) then
13+
count = count + 1
14+
end
15+
end
1616
end
1717

1818
return count
@@ -31,19 +31,19 @@ end
3131
---@param arr2 T[] second array
3232
---@return boolean # are the arrays equal
3333
function M.arrays_equal(arr1, arr2)
34-
if arr1 == arr2 then
35-
return true
36-
elseif #arr1 ~= #arr2 then
37-
return false
38-
end
34+
if arr1 == arr2 then
35+
return true
36+
elseif #arr1 ~= #arr2 then
37+
return false
38+
end
3939

40-
for i = 1, #arr1 do
41-
if arr1[i] ~= arr2[i] then
42-
return false
43-
end
44-
end
40+
for i = 1, #arr1 do
41+
if arr1[i] ~= arr2[i] then
42+
return false
43+
end
44+
end
4545

46-
return true
46+
return true
4747
end
4848

4949
return M

nix/checks.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
overlays = [inputs.neorocks.overlays.default];
1212
};
1313

14+
checks.pre-commit = pkgs.writeShellApplication {
15+
name = "pre-commit-check";
16+
17+
runtimeInputs = [pkgs.pre-commit];
18+
19+
text = "pre-commit run --all-files";
20+
};
21+
1422
checks.default = pkgs.writeShellApplication {
1523
name = "typos-check";
1624

0 commit comments

Comments
 (0)