Skip to content

Commit

Permalink
ci(isort): add documentation for isort
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviml committed Nov 21, 2020
1 parent bc82a2d commit b819074
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ repos:
- id: pytest
name: pytest
entry: pipenv run pytest
language: system
language: python
types: [python]
pass_filenames: false
always_run: true
36 changes: 26 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,57 @@ New controllers need to be added into the `apps/controllerx/devices/` and you wi

Note that this project will only accept the mapping that the original controller would follow with its original hub.

## Imports

Run the following to fix imports order:

```shell
pipenv run isort apps/controllerx/ tests/
```

## Format

Run the following to fix formatting:

```shell
pipenv run black apps/controllerx/ tests/
```

## Typing

Run the following to check consistency in the typings:

```
pipenv run mypy apps/controllerx
```shell
pipenv run mypy apps/controllerx/ tests/
```

## Linting

Run the following to check for stylings:

```
pipenv run flake8 apps/controllerx
```shell
pipenv run flake8 apps/controllerx/ tests/
```

## Test

Run the following command for the tests:

```
```shell
pipenv run pytest --cov=apps
```

or the following to get a report of the missing lines to be tested:

```
```shell
pytest --cov-report term-missing --cov=apps
```

## Pre-commit

Once you have the code ready, pre-commit will run some checks to make sure the code follows the format and the tests did not break. If you want to run the check for all files at any point, run:

```
```shell
pipenv run pre-commit run --all-files
```

Expand All @@ -64,7 +80,7 @@ You can use the tool `commitizen` to commit based in a standard. If you are in t

[Install Jekyll](https://jekyllrb.com/docs/) and run the documentation locally with:

```
```shell
cd docs
bundle install
bundle exec jekyll serve
Expand Down Expand Up @@ -98,13 +114,13 @@ git checkout -b <username>-<remote-branch> <username>/<remote-branch>

Thanks to the Azure Pipelines, we are able to deploy by just creating a new tag on git. So first, we will need to bump version with `commitizen` by running the following line in the `master` branch:

```
```shell
cz bump --no-verify
```

`--prerelease beta` tag can be added to create a pre-release. Note that you can also add `--dry-run` to see which version will bump without commiting anything. Then, we can directly push the tags:

```
```shell
git push origin master --tags
```

Expand Down
10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ stages:
displayName: Lock dependencies
- script: pipenv install --system --deploy --dev
displayName: Install dependencies
- script: isort apps/controllerx tests --check
- script: isort apps/controllerx/ tests/ --check
displayName: Organize imports (isort)
- script: black apps/controllerx/ tests/ --check
displayName: Formatter (black)
- script: black apps/controllerx tests --check
displayName: Formatter (black)
- script: flake8 apps/controllerx tests
- script: flake8 apps/controllerx/ tests/
displayName: Styling (flake8)
- script: mypy apps/controllerx tests/
- script: mypy apps/controllerx/ tests/
displayName: Typing (mypy)
- script: pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=apps --cov-report=xml --cov-report=html
displayName: Tests (pytest)
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"filename": "controllerx.zip",
"hide_default_branch": true,
"name": "ControllerX",
"name": "🎮 ControllerX",
"render_readme": true,
"zip_release": true
}

0 comments on commit b819074

Please sign in to comment.