Skip to content

Commit 6f56342

Browse files
committed
[*] Make gitcc python modular
1 parent dd049a1 commit 6f56342

16 files changed

+506
-364
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: [push, pull_request]
33

44
jobs:
55
build:
6-
name: ${{ matrix.os }} ${{ matrix.python-version }}
6+
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
77
runs-on: ${{ matrix.os }}
88
strategy:
99
fail-fast: false
@@ -22,6 +22,7 @@ jobs:
2222

2323
- name: Install dependencies
2424
shell: bash
25+
working-directory: ./python
2526
run: |
2627
python -m pip install --upgrade pip
2728
pip install --upgrade wheel
@@ -30,26 +31,30 @@ jobs:
3031
3132
- name: Build
3233
shell: bash
34+
working-directory: ./python
3335
run: |
3436
python setup.py clean --all
3537
python setup.py bdist_wheel
3638
3739
- name: Code style check
3840
shell: bash
41+
working-directory: ./python
3942
run: |
4043
flake8 ./gitcc
4144
pyroma .
4245
mypy ./gitcc
4346
4447
- name: Testing
4548
shell: bash
49+
working-directory: ./python
4650
run: |
4751
python setup.py check -v -m -s
4852
twine check dist/*
4953
5054
- name: Publish to PyPI
5155
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10.0' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
52-
uses: pypa/gh-action-pypi-publish@master
56+
uses: pypa/gh-action-pypi-publish@release/v1
5357
with:
58+
packages_dir: python/dist
5459
user: __token__
5560
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/commit_naming.yml renamed to .github/workflows/commit_naming_python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Commit Naming
1+
name: Commit Naming (Python)
22
on:
33
pull_request:
44
branches:

README.rst

Lines changed: 6 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -3,117 +3,16 @@ GitCC
33
*****
44
|maintained| |programming language| |license|
55

6-
|github actions| |requirements|
7-
8-
|pypi|
6+
|github actions|
97

108
----
119

1210
GitCC checks commit messages for certain rules.
1311

14-
----
15-
16-
gitcc [\-h] [\-v] {summary, git-hook, commit, history, branch}
17-
18-
**summary** <text>
19-
check the given summary text
20-
21-
**text**
22-
text to check
23-
24-
..
25-
26-
----
27-
28-
*git-hook* [--force] <action> <hooks> [<hooks> ...] <repository>
29-
install or uninstall a git hook
30-
31-
**<action>**
32-
Install or uninstall. [install, uninstall]
33-
34-
..
35-
36-
**<hooks>**
37-
Choose available hooks. [summary]
38-
39-
..
40-
41-
**<repository>**
42-
path to the repository
43-
44-
..
45-
46-
[options]
47-
**--force**
48-
Force install or uninstall, this might override existing files!
49-
50-
..
51-
52-
----
53-
54-
**commit** <repository>
55-
check current commit
56-
57-
**<repository>**
58-
path to the repository
59-
60-
..
61-
62-
----
63-
64-
**history** [--sha <SHA>] [--verbose] <repository>
65-
check the current branch history
66-
67-
**<repository>**
68-
path to the repository
69-
70-
..
71-
72-
[options]
73-
**--sha** <SHA>
74-
check until this commit (exclusive)
75-
76-
..
77-
78-
**--verbose**
79-
print correct commits too
80-
81-
..
82-
83-
----
84-
85-
**branch** [--verbose] <target> <repository>
86-
check the current branch with an other branch common ancestor. Is the same as gitcc history with git merge-base <source> <target>
87-
88-
..
89-
90-
**<target>**
91-
target branch
92-
93-
..
94-
95-
**<repository>**
96-
path to the repository
97-
98-
..
99-
100-
[options]
101-
**--verbose**
102-
print correct commits too
103-
104-
..
105-
106-
----
107-
108-
**-h**, **--help**
109-
show this help message and exit
110-
111-
..
112-
113-
**-v**, **--version**
114-
show program's version number and exit
115-
116-
..
12+
GitCC is available as a Python implementation, which provides a CLI and local git hooks.
13+
`Python version <./python/README.rst>`__
14+
For a GitHub Actions implementation, when only used in CI, refer to
15+
`Javascript version <./python/README.rst>`__
11716

11817
----
11918

@@ -129,14 +28,6 @@ Credits
12928
- `Iceflower S <https://github.com/IceflowRE>`__
13029
13130

132-
Third Party
133-
-----------
134-
135-
GitPython
136-
- Michael Trier and contributors
137-
- https://github.com/gitpython-developers/GitPython
138-
- `BSD-3-Clause <https://github.com/gitpython-developers/GitPython/blob/main/LICENSE>`__
139-
14031
License
14132
-------
14233

@@ -152,17 +43,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
15243
15344
.. |maintained| image:: https://img.shields.io/badge/maintained-yes-brightgreen.svg
15445

155-
.. |programming language| image:: https://img.shields.io/badge/language-Python_3.10-orange.svg
156-
:target: https://www.python.org/
46+
.. |programming language| image:: https://img.shields.io/badge/language-Python_3.10%20/%20Javascript-orange.svg
15747

15848
.. |license| image:: https://img.shields.io/badge/License-MIT-blue.svg
15949
:target: https://github.com/IceflowRE/gitcc/blob/main/LICENSE.rst
16050

16151
.. |github actions| image:: https://github.com/IceflowRE/gitcc/actions/workflows/build.yml/badge.svg
16252
:target: https://github.com/IceflowRE/gitcc/actions
163-
164-
.. |pypi| image:: https://img.shields.io/pypi/v/gitcc.svg
165-
:target: https://pypi.org/project/gitcc/
166-
167-
.. |requirements| image:: https://requires.io/github/IceflowRE/unidown/requirements.svg?branch=main
168-
:target: https://requires.io/github/IceflowRE/gitcc/requirements/?branch=main

gitcc/git_hook.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

gitcc/git_hooks/__init__.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

gitcc/git_hooks/commit_msg_summary.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)