Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Commit 2fa3ddf

Browse files
committed
init
0 parents  commit 2fa3ddf

File tree

23 files changed

+1057
-0
lines changed

23 files changed

+1057
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @towry
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: It helps making the plugin more stable.
4+
---
5+
6+
## Description
7+
8+
<!-- A clear and concise description of what the bug is. -->
9+
10+
## Steps to reproduce
11+
12+
1. I did the command `...`
13+
2. Then I saw `...`
14+
3. Error
15+
16+
## Expected behavior
17+
18+
<!-- A clear and concise description of what you expected to happen. -->
19+
20+
## Environment
21+
22+
- Neovim version: [e.g. 0.5.x / 0.6.x / 0.7.x / 0.8.x / Nightly]
23+
- commit-msg-sg version: [e.g. latest / 0.1.2 / dev]
24+
- Plugin clash: [e.g. Telescope float window / lsp diagnostic]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Feature request
3+
about: Suggest anything that would make your life easier, or the plugin better.
4+
---
5+
6+
## Describe the problem
7+
8+
<!-- Explain what the new feature is, or if it's for the documentation, what do you expect. -->
9+
10+
## Describe the solution
11+
12+
<!-- Explain what your solution would look like. -->
13+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 📃 Summary
2+
3+
<!-- Provide some context about the pull request, it makes the review easier. -->
4+
5+
## 📸 Preview
6+
7+
<!-- If there's a visual impact to your change, please provide a screenshot. You can directly upload it to GitHub by dragging in this text area. -->

.github/workflows/main.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
concurrency:
10+
group: github.head_ref
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
name: lint
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- uses: JohnnyMorganz/stylua-action@v2
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
version: latest
24+
args: --check .
25+
26+
documentation:
27+
runs-on: ubuntu-latest
28+
name: documentation
29+
steps:
30+
- uses: actions/checkout@v3
31+
with:
32+
fetch-depth: 2
33+
34+
- name: setup neovim
35+
uses: rhysd/action-setup-vim@v1
36+
with:
37+
neovim: true
38+
version: v0.8.3
39+
40+
- name: generate documentation
41+
run: make documentation-ci
42+
43+
- name: check docs diff
44+
run: exit $(git status --porcelain doc | wc -l | tr -d " ")
45+
46+
tests:
47+
needs:
48+
- lint
49+
- documentation
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 2
52+
strategy:
53+
matrix:
54+
neovim_version: ["v0.7.2", "v0.8.3", "v0.9.1", "nightly"]
55+
56+
steps:
57+
- uses: actions/checkout@v3
58+
59+
- run: date +%F > todays-date
60+
61+
- name: restore cache for today's nightly.
62+
uses: actions/cache@v3
63+
with:
64+
path: _neovim
65+
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}
66+
67+
- name: setup neovim
68+
uses: rhysd/action-setup-vim@v1
69+
with:
70+
neovim: true
71+
version: ${{ matrix.neovim_version }}
72+
73+
- name: run tests
74+
run: make test-ci
75+
76+
release:
77+
name: release
78+
if: ${{ github.ref == 'refs/heads/main' }}
79+
needs:
80+
- tests
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v3
84+
85+
- uses: google-github-actions/release-please-action@v3
86+
id: release
87+
with:
88+
release-type: simple
89+
package-name: commit-msg-sg.nvim
90+
91+
- name: tag stable versions
92+
if: ${{ steps.release.outputs.release_created }}
93+
run: |
94+
git config user.name github-actions[bot]
95+
git config user.email github-actions[bot]@users.noreply.github.com
96+
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
97+
git tag -d stable || true
98+
git push origin :stable || true
99+
git tag -a stable -m "Last Stable Release"
100+
git push origin stable

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deps
2+
**.DS_Store
3+
.luarc.json

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Towry Wang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# we disable the `all` command because some external tool might run it automatically
2+
.SUFFIXES:
3+
4+
all:
5+
6+
# runs all the test files.
7+
test:
8+
nvim --version | head -n 1 && echo ''
9+
nvim --headless --noplugin -u ./scripts/minimal_init.lua \
10+
-c "lua require('mini.test').setup()" \
11+
-c "lua MiniTest.run({ execute = { reporter = MiniTest.gen_reporter.stdout({ group_depth = 1 }) } })"
12+
13+
# installs `mini.nvim`, used for both the tests and documentation.
14+
deps:
15+
@mkdir -p deps
16+
git clone --depth 1 https://github.com/echasnovski/mini.nvim deps/mini.nvim
17+
18+
# installs deps before running tests, useful for the CI.
19+
test-ci: deps test
20+
21+
# generates the documentation.
22+
documentation:
23+
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua require('mini.doc').generate()" -c "qa!"
24+
25+
# installs deps before running the documentation generation, useful for the CI.
26+
documentation-ci: deps documentation
27+
28+
# performs a lint check and fixes issue if possible, following the config in `stylua.toml`.
29+
lint:
30+
stylua .
31+
32+
# setup
33+
setup:
34+
./scripts/setup.sh

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<p align="center">
2+
<h1 align="center">commit-msg-sg.nvim</h2>
3+
</p>
4+
5+
<p align="center">
6+
Write git commit message with AI (sg.nvim).
7+
</p>
8+
9+
<div align="center">
10+
> Drag your video (<10MB) here to host it for free on GitHub.
11+
</div>
12+
13+
## 📋 Installation
14+
15+
<div align="center">
16+
<table>
17+
<thead>
18+
<tr>
19+
<th>Package manager</th>
20+
<th>
21+
Snippet
22+
</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
<tr>
27+
<td>
28+
29+
[folke/lazy.nvim](https://github.com/folke/lazy.nvim)
30+
31+
</td>
32+
<td>
33+
34+
```lua
35+
{
36+
'towry/commit-msg-sg.nvim',
37+
opts = {
38+
-- see doc
39+
},
40+
cmd = { 'WriteGitCommitMessage' },
41+
ft = 'gitcommit',
42+
}
43+
```
44+
45+
</td>
46+
</tr>
47+
</tbody>
48+
</table>
49+
</div>
50+
51+
## ☄ Getting started
52+
53+
1. Open git commit buffer in your neovim.
54+
2. run `:WriteGitCommitMessage`.
55+
56+
## 🧰 Commands
57+
58+
| Command | Description |
59+
| ------------------------ | ------------------------------------------- |
60+
| `:WriteGitCommitMessage` | Let AI write the git commit message for you |
61+
62+
## ⌨ Contributing
63+
64+
PRs and issues are always welcome. Make sure to provide as much context as possible when opening one.
65+
66+
## 🗞 Wiki
67+
68+
You can find guides and showcase of the plugin on [the Wiki](https://github.com/towry/commit-msg-sg.nvim/wiki)
69+
70+
## 🎭 Motivations
71+
72+
> If alternatives of your plugin exist, you can provide some pros/cons of using yours over the others.

doc/commit-msg-sg.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
==============================================================================
2+
------------------------------------------------------------------------------
3+
*CommitMsgSg.options*
4+
`CommitMsgSg.options`
5+
Your plugin configuration with its default values.
6+
7+
Default values:
8+
>
9+
CommitMsgSg.options = {
10+
-- Prints useful logs about what event are triggered, and reasons actions are executed.
11+
debug = false,
12+
}
13+
14+
<
15+
16+
------------------------------------------------------------------------------
17+
*CommitMsgSg.setup()*
18+
`CommitMsgSg.setup`({options})
19+
Define your commit-msg-sg setup.
20+
21+
Parameters ~
22+
{options} `(table)` Module config table. See |CommitMsgSg.options|.
23+
24+
Usage ~
25+
`require("commit-msg-sg").setup()` (add `{}` with your |CommitMsgSg.options| table)
26+
27+
28+
vim:tw=78:ts=8:noet:ft=help:norl:

0 commit comments

Comments
 (0)