-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Code Linter Action for push and pull requests (#20)
* Add super-linter github action and fix existing issues * fix linter issues for dotenv-linter * Update Dockerfile and hadolint config file * Fix markdownlint issues and remove natural language linting * fix pylint and flake8 linting issues * Disable validate all after resolving all lint issues https://github.com/dting/staketaxcsv/actions/runs/1680632730
- Loading branch information
Showing
82 changed files
with
1,138 additions
and
433 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
########################## | ||
## Hadolint config file ## | ||
########################## | ||
ignored: | ||
- DL3008 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[settings] | ||
profile=black | ||
default_section=FIRSTPARTY | ||
line_length=120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
################################# | ||
################################# | ||
## Super Linter GitHub Actions ## | ||
################################# | ||
################################# | ||
name: Lint Code Base | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
name: Lint Code Base | ||
# Set the agent to run on | ||
runs-on: ubuntu-latest | ||
|
||
################## | ||
# Load all steps # | ||
################## | ||
steps: | ||
########################## | ||
# Checkout the code base # | ||
########################## | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
|
||
################################ | ||
# Run Linter against code base # | ||
################################ | ||
- name: Lint Code Base | ||
uses: github/super-linter@v4 | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
VALIDATE_JSCPD: false | ||
VALIDATE_NATURAL_LANGUAGE: false | ||
VALIDATE_PYTHON_BLACK: false | ||
VALIDATE_PYTHON_MYPY: false | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[settings] | ||
profile=black | ||
default_section=FIRSTPARTY | ||
line_length=120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,67 @@ | ||
|
||
# staketaxcsv | ||
|
||
* Python repo to create blockchain CSVs for Terra (LUNA), Solana (SOL), Cosmos (ATOM), | ||
and Osmosis (OSMO) blockchains. | ||
* CSV codebase for https://stake.tax | ||
* Community contribution and PRs are most welcome, especially to fix/support new types of | ||
protocols/transactions. | ||
* Python repository to create blockchain CSVs for Terra (LUNA), Solana (SOL), Cosmos (ATOM), | ||
and Osmosis (OSMO) blockchains. | ||
* CSV codebase for <https://stake.tax> | ||
* Community contribution and PRs are most welcome, especially to fix/support new types of | ||
protocols/transactions. | ||
|
||
# Usage | ||
|
||
* Same arguments apply for report_terra.py (LUNA), report_sol.py (SOL), report_atom.py (ATOM), | ||
report_osmo.py (OSMO): | ||
``` | ||
# Load environment variables from sample.env (add to ~/.bash_profile or ~/.bashrc to avoid doing every time) | ||
set -o allexport | ||
source sample.env | ||
set +o allexport | ||
cd src | ||
# Create default CSV | ||
python3 report_terra.py <wallet_address> | ||
# Create all CSV formats (i.e. koinly, cointracking, etc.) | ||
python3 report_terra.py <wallet_address> --format all | ||
# Show CSV result for single transaction (great for development/debugging) | ||
python3 report_terra.py <wallet_address> --txid <txid> | ||
``` | ||
* Same arguments apply for report_terra.py (LUNA), report_sol.py (SOL), report_atom.py (ATOM), | ||
report_osmo.py (OSMO): | ||
|
||
```sh | ||
# Load environment variables from sample.env (add to ~/.bash_profile or ~/.bashrc to avoid doing every time) | ||
set -o allexport | ||
source sample.env | ||
set +o allexport | ||
|
||
cd src | ||
|
||
# Create default CSV | ||
python3 report_terra.py <wallet_address> | ||
|
||
# Create all CSV formats (i.e. koinly, cointracking, etc.) | ||
python3 report_terra.py <wallet_address> --format all | ||
|
||
# Show CSV result for single transaction (great for development/debugging) | ||
python3 report_terra.py <wallet_address> --txid <txid> | ||
``` | ||
|
||
# Install | ||
|
||
1. Install python 3.9 ([one way](README_reference.md#installing-python-39-on-macos)) | ||
2. Install pip packages | ||
``` | ||
|
||
```sh | ||
pip3 install -r requirements.txt | ||
``` | ||
|
||
# Docker | ||
|
||
See [Docker](README_reference.md#docker) to alternatively install/run in docker container. | ||
|
||
# Contributing Code | ||
|
||
* Code style follows `pep8`. This can be tested with `pycodestyle`. | ||
* Providing a sample txid will expedite a pull request (email support@stake.tax, | ||
DM @staketax, etc.): | ||
``` | ||
# For a given txid, your PR (most commonly) should print different output before/after: | ||
python3 report_terra.py <wallet_address> --txid <txid> | ||
``` | ||
* Code style follows `pep8`. This can be tested with `pycodestyle`. | ||
* Providing a sample txid will expedite a pull request (email support@stake.tax, | ||
DM @staketax, etc.): | ||
|
||
```sh | ||
# For a given txid, your PR (most commonly) should print different output before/after: | ||
python3 report_terra.py <wallet_address> --txid <txid> | ||
``` | ||
|
||
# Reference | ||
|
||
See [README_reference.md](README_reference.md): | ||
|
||
* [Code Style](README_reference.md#code-style) | ||
* [Unit Tests](README_reference.md#unit-tests) | ||
* [Docker](README_reference.md#docker) | ||
* [Ideal Configuration](README_reference.md#ideal-configuration) | ||
* [RPC Node Settings](README_reference.md#rpc-node-settings) | ||
* [DB Cache](README_reference.md#db-cache) | ||
* [Installing python 3.9.9 on MacOS](README_reference.md#installing-python-39-on-macos) | ||
* [Code Style](README_reference.md#code-style) | ||
* [Unit Tests](README_reference.md#unit-tests) | ||
* [Docker](README_reference.md#docker) | ||
* [Ideal Configuration](README_reference.md#ideal-configuration) | ||
* [RPC Node Settings](README_reference.md#rpc-node-settings) | ||
* [DB Cache](README_reference.md#db-cache) | ||
* [Installing python 3.9.9 on macOS](README_reference.md#installing-python-39-on-macos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
import logging | ||
import time | ||
|
||
from atom.config_atom import localconfig | ||
|
||
SECONDS_PER_PAGE = 15.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.