mirror of
https://github.com/Rikj000/MoniGoMani.git
synced 2022-03-06 00:08:05 +03:00
Updated CONTRIBUTING.md
This commit is contained in:
45
.github/CONTRIBUTING.md
vendored
45
.github/CONTRIBUTING.md
vendored
@@ -1,16 +1,23 @@
|
||||
# Contributing to MGM
|
||||
# Contributing to MoniGoMani Hyper Strategy
|
||||
|
||||
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
|
||||
|
||||
|
||||
The following is a set of guidelines for contributing to the MoniGoMani Hyper Strategy and its modules, which are hosted in the [Rikj000 repository](https://github.com/Rikj000/MoniGoMani) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||
|
||||

|
||||

|
||||
## Development
|
||||
---
|
||||
|
||||
Some developer notes. Never forget.
|
||||
Table of Contents
|
||||
-
|
||||
|
||||
### Installation instructions
|
||||
* [Installation instructions](#installation-instructions)
|
||||
* [Using pre-commit hooks](#using-pre-commit-hooks)
|
||||
* [GitHub Action Workflows](#github-action-workflows)
|
||||
|
||||
---
|
||||
|
||||
Installation instructions
|
||||
------
|
||||
|
||||
We use `pipenv` for virtual environments. We install all packages and its dependencies using `pipenv`. Also we run all commands using `pipenv` to ensure we've the right dependencies and do not interfere with other environments or dependencies.
|
||||
|
||||
@@ -27,12 +34,10 @@ pipenv install --dev
|
||||
pipenv run pytest -c pytest.ini tests/
|
||||
```
|
||||
|
||||
### Pre-commit hooks
|
||||
Using pre-commit hooks
|
||||
------
|
||||
|
||||
Using a pre-commit hook, most of the checks, linting and testing is executed
|
||||
automatically. It is configured in `.pre-commit-config.yaml` and used by the [pre-commit.com](https://pre-commit.com/) tool.
|
||||
|
||||
See [pre-commit.com](https://pre-commit.com) for installation and usage instructions.
|
||||
This project uses a set of git commit hooks to help us developers to write – *and more important, maintain* – code mostly in the same style & fashion. These hooks are configured in `.pre-commit-config.yaml` and can be run on your machine by using an automated [pre-commit](https://pre-commit.com) integration.
|
||||
|
||||
**Run pre-commit only at changed files:**
|
||||
|
||||
@@ -43,15 +48,7 @@ pipenv run pre-commit run --from-ref HEAD^^^ --to-ref HEAD
|
||||
**Run pre-commit at all files:**
|
||||
|
||||
```bash
|
||||
pipenv run pre-commit run --all
|
||||
```
|
||||
|
||||
### Git Commit Hook(s)
|
||||
|
||||
This project uses a set of git commit hooks to help us developers to write – *and more important, commit & push* – code mostly in the same fashion. These hooks are configured in `.pre-commit-config.yaml` and can be run on your machine by using an automated [pre-commit](https://pre-commit.com) integration.
|
||||
|
||||
```shell
|
||||
$ pre-commit run --all
|
||||
$ pipenv run pre-commit run --all
|
||||
|
||||
~/Projects/MoniGoMani(master) » pre-commit run --all
|
||||
|
||||
@@ -77,8 +74,14 @@ Check for case conflicts.................................................Passed
|
||||
|
||||
See https://pre-commit.com for usage and installation instructions.
|
||||
|
||||
### GitHub Action Workflows
|
||||
GitHub Action Workflows
|
||||
------
|
||||
|
||||
GitHub Actions are used in order to run automated unit-tests against our code. These actions are triggered at push-events into main, development and feature/* branches. These actions are also triggered at every Pull Request so we all can see very quickly if something happened.
|
||||
|
||||
It can be quite handy to run a GitHub action workflow on your local machine. Well, [act](https://github.com/nektos/act) is your friend.
|
||||
|
||||
---
|
||||
|
||||

|
||||

|
||||
@@ -67,5 +67,5 @@ repos:
|
||||
entry: pytest
|
||||
language: system
|
||||
types: [python]
|
||||
files: 'mgm_hurry_.*?_test\.py$'
|
||||
files: '.*?(mgm).*?(_test)\.py$'
|
||||
verbose: true
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
[pytest]
|
||||
minversion = 6.0
|
||||
console_output_style = classic
|
||||
python_files = "tests/mgm*_test.py"
|
||||
python_files = mgm*_test.py
|
||||
testpaths =
|
||||
tests
|
||||
addopts = --cov --cov-append --doctest-modules --junitxml=tests/junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
|
||||
@@ -151,15 +151,15 @@ class FreqtradeCli():
|
||||
self.cli_logger.critical('Failed to clone freqtrade repo. I quit!')
|
||||
os.sys.exit(1)
|
||||
|
||||
YASPIN_INSTANCE.ok("✔")
|
||||
YASPIN_INSTANCE.ok('✔')
|
||||
|
||||
with yaspin(text='Copy freqtrade installation', color='cyan') as YASPIN_INSTANCE:
|
||||
self.monigomani_cli.run_command('cp -R {0}/* {1}'.format(temp_dirname, target_dir))
|
||||
YASPIN_INSTANCE.ok("✔")
|
||||
YASPIN_INSTANCE.ok('✔')
|
||||
|
||||
if os.path.isfile('{0}/setup.sh'.format(target_dir)):
|
||||
self.monigomani_cli.run_command('bash {0}/setup.sh --install'.format(target_dir))
|
||||
YASPIN_INSTANCE.ok("✔ Freqtrade installation completed")
|
||||
YASPIN_INSTANCE.ok('✔ Freqtrade installation completed')
|
||||
else:
|
||||
self.cli_logger.error(
|
||||
'Could not run {0}/setup.sh for freqtrade because the file does not exist.'
|
||||
|
||||
@@ -99,4 +99,4 @@ class MoniGoManiCli(object):
|
||||
|
||||
cmd = shlex.split(command)
|
||||
|
||||
return shell_call(" ".join(cmd), shell=True)
|
||||
return shell_call(' '.join(cmd), shell=True)
|
||||
|
||||
Reference in New Issue
Block a user