Skip to content

Commit

Permalink
feat: README.md include to work in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lpmatos committed Jul 28, 2020
1 parent 8a6e7f7 commit c814473
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 243 deletions.
8 changes: 7 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
include README.md LICENSE
exclude .gitignore
include README.md
include LICENSE
prune .cache
prune .git
prune build
prune dist
232 changes: 3 additions & 229 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,231 +1,5 @@
<p align="center">
<img alt="commitlint" src="https://img2.gratispng.com/20180713/hfv/kisspng-logo-version-control-gitlab-brand-e-commerce-gitlab-5b482945dfad48.8320886315314558139162.jpg" width="250px" float="center"/>
</p>
**GitLabRC** (GitLab Recursive Clone)

<h1 align="center">Welcome to GitLab Clone Recursive repository</h1>
This Python CLI is a very simple tool that help you to clone all projects inside a [gitlab](http://www.gitlab.com) group.

<p align="center">
<strong>Automate clone your projects in GitLab</strong>
</p>

<p align="center">
<a href="https://github.com/lpmatos/gitlab-clone">
<img alt="Open Source" src="https://badges.frapsoft.com/os/v1/open-source.svg?v=102">
</a>

<a href="https://github.com/lpmatos/gitlab-clone">
<img alt="GitHub Language Count" src="https://img.shields.io/github/languages/count/lpmatos/gitlab-clone">
</a>

<a href="https://github.com/lpmatos/gitlab-clone/stargazers">
<img alt="GitHub Stars" src="https://img.shields.io/github/stars/lpmatos/gitlab-clone?style=social">
</a>

<a href="https://github.com/lpmatos/gitlab-clone/commits/master">
<img alt="GitHub Last Commit" src="https://img.shields.io/github/last-commit/lpmatos/gitlab-clone">
</a>

<a href="https://github.com/lpmatos/gitlab-clone">
<img alt="Repository Size" src="https://img.shields.io/github/repo-size/lpmatos/gitlab-clone">
</a>

<a href="https://github.com/lpmatos/gitlab-clone/blob/master/LICENSE">
<img alt="MIT License" src="https://img.shields.io/github/license/lpmatos/gitlab-clone">
</a>
</p>

### Menu

<p align="left">
<a href="#pre-requisites">Pre-Requisites</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="#description">Description</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="#how-to-contribute">How to contribute</a>
</p>

### Getting Started

If you want use this repository you need to make a **git clone**:

```bash
git clone --depth 1 https://github.com/lpmatos/gitlab-clone-recursive.git -b master
```

This will give access on your **local machine**.

### Pre-Requisites

To **develop** in this project you yeed:

* NPM | Yarn (package tool)
* Install Packages
* NodeJS
* Python
* Docker and Docker Compose

To **use** this project you yeed:

* Packages
* Git Installation and Configuration
* Install Package gitlab-clone-recursive

### How to use it?

#### Locale

1. Install package.json dependencies.
2. Git add files.
3. Run npm run commit to call commitizen, build your commit message and husky validate it.
4. Push to remote repository.
5. Profit.

### Description

#### Create good commit messages

We all did bad commit messages. Lucky us, Conventional Commits specification exists, and with it a set of powerful tools to help us.

To enforce a standard every time we make a commit, we have husky and commitlint. Husky listen to git hooks, and we will use it to trigger the commitlint when we type a commit message.

Commitizen is a package that makes it easier to create commit messages following the previous specification.

* husky
* commitlint
* commitizen

#### Commit Lint

<strong>Requirements:</strong>

> OBS: Required .git folder in project
* .git in folder
* Node
* yarn | npm

<strong>Install by default [package.json](package.json):</strong>

```cmd
yarn install
```

<strong>Manual Installment:</strong>

```cmd
yarn init -y
yarn add @commitlint/config-conventional @commitlint/cli husky commitizen -D
echo module.exports = {extends: ['@commitlint/config-conventional']} > commitlint.config.js
```

Add configuration in package.json:

```json
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
```

<strong>Use:</strong>

With dependencies already installed, commits that do not follow the semmantic commit rules will be automatically blocked in the development environment

```cmd
C:\> git add .
C:\> git commit -m "commit"
husky > commit-msg (node v12.14.0)
⧗ input: commit
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
husky > commit-msg hook failed (add --no-verify to bypass)
```

Using the commitzen, previously installed, an auxiliary service will be available to build the commits

```cmd
C:\> git add .
C:\> npm run commit
cz-cli@4.0.3, cz-conventional-changelog@3.2.0
? Select the type of change that you're committing: (Use arrow keys)
> feat: A new feature
fix: A bug fix
docs: Documentation only changes
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor: A code change that neither fixes a bug nor adds a feature
perf: A code change that improves performance
test: Adding missing tests or correcting existing tests
build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
chore: Other changes that don't modify src or test files
revert: Reverts a previous commit
```

### Python Package

```bash
python3 setup.py register sdist upload
```

### How to contribute

>
> 1. Make a **Fork**.
> 2. Follow the project organization.
> 3. Add the file to the appropriate level folder - If the folder does not exist, create according to the standard.
> 4. Make the **Commit**.
> 5. Open a **Pull Request**.
> 6. Wait for your pull request to be accepted.. 🚀
>
Remember: There is no bad code, there are different views/versions of solving the same problem. 😊

### Add to git and push

You must send the project to your GitHub after the modifications

```bash
git add -f .
git commit -m "Added - Fixing somethings"
git push -u origin master
```

### Versioning

- [CHANGELOG](CHANGELOG.md)

### License

Distributed under the MIT License. See [LICENSE](LICENSE) for more information.

### Author

👤 **Lucca Pessoa**

Hey!! If you like this project or if you find some bugs feel free to contact me in my channels:

> * Email: luccapsm@gmail.com
> * Website: https://github.com/lpmatos
> * Github: [@lpmatos](https://github.com/lpmatos)
> * LinkedIn: [@luccapessoa](https://www.linkedin.com/in/lucca-pessoa-4abb71138/)
### Show your support

Give a ⭐️ if this project helped you!

---

<p align="center">Feito com ❤️ by <strong>Lucca Pessoa :wave:</p>
This project is inspired from [gitup](https://github.com/ezbz/gitlabber) and has parts taken from there.
2 changes: 0 additions & 2 deletions README.rst

This file was deleted.

2 changes: 1 addition & 1 deletion gitlabrc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

VERSION = (0, 0, 9)
VERSION = (0, 0, 11)

__version__ = ".".join(map(str, VERSION))
2 changes: 2 additions & 0 deletions gitlabrc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from typing import NoReturn, Text
from argparse import ArgumentParser, RawTextHelpFormatter

# https://docs.python.org/3/library/argparse.html

class Arguments:

def __init__(self, argv=None) -> NoReturn:
Expand Down
9 changes: 6 additions & 3 deletions gitlabrc/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
Examples:
Clone all projects inside specific namespace in current directory:
Clone all repositories inside specific namespace in current directory:
gitlabcr -u $GITLAB_URL -t $GITLAB_TOKEN -n msp/charts
Clone all projects inside specific namespace in specific directory:
Clone all repositories inside specific namespace in specific directory:
gitlabcr -u $GITLAB_URL -t $GITLAB_TOKEN -n msp/charts -p /home/ubuntu
Getting projects with specific git clone method:
Getting repositories with specific git clone method:
gitlabcr -u $GITLAB_URL -t $GITLAB_TOKEN -n msp/charts -p /home/ubuntu -m http
Show all repositories without clone/fetch:
gitlabcr -u $GITLAB_URL -t $GITLAB_TOKEN -n msp/charts --dry-run
"""
1 change: 1 addition & 0 deletions gitlabrc/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Text, Type

"""
https://docs.python.org/3/library/enum.html
https://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python
"""

Expand Down
2 changes: 2 additions & 0 deletions gitlabrc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from os import environ
from typing import Text, Type, Optional

# https://docs.python.org/3/library/typing.html

class Config:

@staticmethod
Expand Down
13 changes: 6 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-

import io
import os
from gitlabrc import __version__
from os.path import abspath, dirname, join
from setuptools import setup, find_packages

# Package meta-data.
Expand All @@ -20,22 +19,22 @@
]

# Getting current location of this file.
here = os.path.abspath(os.path.dirname(__file__))
here = abspath(dirname(__file__))

# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
try:
with io.open(os.path.join(here, "README.md"), encoding="utf-8") as longdesc:
LONG_DESCRIPTION = "\n" + longdesc.read()
with open(join(here, "README.md"), encoding="utf-8") as file:
longdesc = file.read()
except FileNotFoundError:
LONG_DESCRIPTION = DESCRIPTION
longdesc = DESCRIPTION

# Build setup package.
setup(
name = NAME,
version = VERSION,
description = DESCRIPTION,
long_description = DESCRIPTION,
long_description = longdesc,
long_description_content_type = "text/markdown",
author = AUTHOR,
author_email = EMAIL,
Expand Down

0 comments on commit c814473

Please sign in to comment.