Skip to content

Commit

Permalink
Add .editorconfig (#21)
Browse files Browse the repository at this point in the history
- Remove leading newlines
- Add trailing newline
- Ignore indent size linting since python argument wrapping violates
  fixed indentation rules
  • Loading branch information
dting authored Jan 11, 2022
1 parent af274d5 commit e8fc35d
Show file tree
Hide file tree
Showing 69 changed files with 55 additions and 78 deletions.
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# Python Files
[*.py]
max_line_length = 120

# Markdown Files
[*.md]
indent_size = 2
max_line_length = 120
trim_trailing_whitespace = false

# JSON Files
[*.json]
indent_size = 2

# YAML Files
[*.{yml,yaml}]
indent_size = 2
18 changes: 18 additions & 0 deletions .github/linters/.ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"exclude": ["testfiles"],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"IndentSize": true,
"MaxLineLength": false
}
}
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

FROM python:3.9.9-slim

ENV APPHOME=/staketaxcsv
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Install

1. Install python 3.9 ([one way](README_reference.md#installing-python-39-on-macos))
2. Install pip packages
1. Install pip packages

```sh
pip3 install -r requirements.txt
Expand Down
16 changes: 7 additions & 9 deletions README_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

# Unit Tests

You may notice a lack of unit tests in this codebase. Though tests exist, I omitted them because they rely on extensive
use of real world wallet data. For the sake of all users' privacy, I do not include these tests. I'm open to
ideas for alternatives, since obviously this is non-optimal.
You may notice a lack of unit tests in this codebase. Though tests exist, I omitted them because they rely on extensive
use of real world wallet data. For the sake of all users' privacy, I do not include these tests. I'm open to ideas for
alternatives, since obviously this is non-optimal.

# Docker

Expand All @@ -35,9 +35,8 @@ docker run --platform linux/amd64 -it --volume $PWD:/staketaxcsv staketaxcsv bas

# Ideal Configuration

Default code was made to work out of the box. These are changes that require manual
actions. They improve reliability (RPC Node settings) or speed (DB Cache) when compared to
default version.
Default code was made to work out of the box. These are changes that require manual actions. They improve reliability
(RPC Node settings) or speed (DB Cache) when compared to default version.

## RPC Node settings

Expand All @@ -47,8 +46,8 @@ default version.

## DB Cache

Use of a database for caching is ideal to speed up certain RPC queries (especially SOL). Here is
the script usage to enable caching:
Use of a database for caching is ideal to speed up certain RPC queries (especially SOL). Here is the script usage to
enable caching:

```sh
cd src
Expand Down Expand Up @@ -85,4 +84,3 @@ Alternatively, you may implement your own Cache class (common/cache.py).
# install pip packages (same as README.md)
pip3 install -r requirements.txt
```

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

max-line-length = 120
ignore = E501, W605, W503
exclude = env/*
exclude = env/*
1 change: 0 additions & 1 deletion src/atom/config_atom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class localconfig:

job = None
Expand Down
1 change: 0 additions & 1 deletion src/atom/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

EXCHANGE_COSMOS_BLOCKCHAIN = "cosmos_blockchain"
CUR_ATOM = "ATOM"
MILLION = 1000000.0
Expand Down
2 changes: 0 additions & 2 deletions src/common/ErrorCounter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import logging


Expand Down
1 change: 0 additions & 1 deletion src/common/ExporterTypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Note: TX_TYPE=_* means transaction is not included in non-default CSVs
# (i.e. _STAKING_DELEGATE is not included in koinly, cointracking, ... )

Expand Down
1 change: 0 additions & 1 deletion src/common/TxInfo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class TxInfo:

def __init__(self, txid, timestamp, fee, fee_currency, wallet_address, exchange, url):
Expand Down
1 change: 0 additions & 1 deletion src/osmo/TxInfoOsmo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.TxInfo import TxInfo
from osmo.constants import CUR_OSMO, EXCHANGE_OSMOSIS

Expand Down
1 change: 0 additions & 1 deletion src/osmo/config_osmo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class localconfig:

job = None
Expand Down
1 change: 0 additions & 1 deletion src/osmo/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

MILLION = 1000000.0
EXP18 = 10 ** 18
EXCHANGE_OSMOSIS = "osmosis_blockchain"
Expand Down
1 change: 0 additions & 1 deletion src/osmo/handle_lp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging

from osmo import util_osmo
Expand Down
1 change: 0 additions & 1 deletion src/osmo/handle_staking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import osmo.constants as co
from common.ExporterTypes import (
TX_TYPE_OSMO_WITHDRAW_COMMISSION,
Expand Down
1 change: 0 additions & 1 deletion src/osmo/handle_swap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from osmo.handle_claim import handle_claim
from osmo.handle_unknown import handle_unknown_detect_transfers
from osmo.make_tx import make_osmo_swap_tx
Expand Down
1 change: 0 additions & 1 deletion src/osmo/handle_unknown.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from osmo import util_osmo
from osmo.make_tx import make_osmo_unknown_tx, make_osmo_unknown_tx_with_transfer

Expand Down
1 change: 0 additions & 1 deletion src/osmo/lp_rewards.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from osmo import api_data
from osmo.make_tx import make_lp_reward_tx

Expand Down
1 change: 0 additions & 1 deletion src/osmo/make_tx.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.Exporter import Row
from common.ExporterTypes import TX_TYPE_STAKING
from common.make_tx import (
Expand Down
1 change: 0 additions & 1 deletion src/osmo/processor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging
from datetime import datetime

Expand Down
1 change: 0 additions & 1 deletion src/settings_csv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import os

# Environment variables (required for each respective report)
Expand Down
1 change: 0 additions & 1 deletion src/sol/ProgressSol.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging
import time

Expand Down
1 change: 0 additions & 1 deletion src/sol/api_rpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging
import random
import time
Expand Down
1 change: 0 additions & 1 deletion src/sol/config_sol.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class localconfig:

job = None
Expand Down
2 changes: 0 additions & 2 deletions src/sol/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


CURRENCY_SOL = "SOL"
EXCHANGE_SOLANA_BLOCKCHAIN = "solana_blockchain"

Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_account_misc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.ExporterTypes import TX_TYPE_SOL_CLOSE_ACCOUNT, TX_TYPE_SOL_INIT_ACCOUNT
from sol.constants import (
INSTRUCTION_TYPE_CLOSE_ACCOUNT,
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_djv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Unknown program DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1

from common.make_tx import make_swap_tx
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_marinade.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_swap_tx
from sol.handle_simple import handle_unknown_detect_transfers

Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_metaplex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_swap_tx
from sol.handle_simple import handle_unknown_detect_transfers

Expand Down
2 changes: 0 additions & 2 deletions src/sol/handle_nft_market.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


from common.make_tx import make_swap_tx
from sol import constants as co
from sol.handle_simple import handle_unknown_detect_transfers
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_notimestamp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.ExporterTypes import TX_TYPE_MISSING_TIMESTAMP
from common.make_tx import make_simple_tx

Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_orca.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_swap_tx
from sol.handle_simple import handle_unknown_detect_transfers

Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_raydium_lp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_swap_tx
from sol import util_sol
from sol.handle_simple import handle_unknown
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_raydium_stake.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import re

from common.make_tx import make_reward_tx
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_saber.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.ExporterTypes import TX_TYPE_SOL_INIT_ACCOUNT
from common.make_tx import make_swap_tx
from sol.handle_simple import handle_unknown_detect_transfers
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_simple.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.ExporterTypes import (
TX_TYPE_SOL_STAKING_CREATE,
TX_TYPE_SOL_STAKING_DEACTIVATE,
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_swap_v2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Swap V2 Program: SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8

from common.make_tx import make_swap_tx
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_transfer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_transfer_in_tx, make_transfer_out_tx
from sol import util_sol
from sol.constants import (
Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_unknowns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_swap_tx
from sol.handle_simple import handle_unknown

Expand Down
1 change: 0 additions & 1 deletion src/sol/handle_vote.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_transfer_in_tx
from sol.constants import BILLION, CURRENCY_SOL
from sol.handle_simple import handle_unknown_detect_transfers
Expand Down
1 change: 0 additions & 1 deletion src/sol/make_tx.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.Exporter import Row
from common.ExporterTypes import (
TX_TYPE_SOL_LP_DEPOSIT,
Expand Down
1 change: 0 additions & 1 deletion src/sol/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

"""
Data parsing functions applicable to all transactions
"""
Expand Down
1 change: 0 additions & 1 deletion src/sol/processor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging

from common.ErrorCounter import ErrorCounter
Expand Down
1 change: 0 additions & 1 deletion src/sol/staking_rewards.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import csv
import logging
import os
Expand Down
2 changes: 1 addition & 1 deletion src/sol/tickers/solana.tokenlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -28610,4 +28610,4 @@
"minor": 3,
"patch": 3
}
}
}
1 change: 0 additions & 1 deletion src/sol/tickers/tickers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import json
import logging
import os
Expand Down
1 change: 0 additions & 1 deletion src/sol/util_sol.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging

from sol.constants import CURRENCY_SOL, MILLION
Expand Down
1 change: 0 additions & 1 deletion src/terra/ProgressTerra.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging
import time

Expand Down
1 change: 0 additions & 1 deletion src/terra/api_fcd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging
import time

Expand Down
1 change: 0 additions & 1 deletion src/terra/api_search_figment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import time

import requests
Expand Down
1 change: 0 additions & 1 deletion src/terra/config_terra.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class localconfig:

job = None
Expand Down
1 change: 0 additions & 1 deletion src/terra/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

MILLION = 1000000.0

CONTRACTS_LOTA = [
Expand Down
1 change: 0 additions & 1 deletion src/terra/execute_type.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import base64
import json
import logging
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_anchor_bond.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.ErrorCounter import ErrorCounter
from common.make_tx import make_unknown_tx
from terra import util_terra
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_anchor_borrow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_borrow_tx, make_repay_tx
from terra import util_terra
from terra.make_tx import make_deposit_collateral_tx, make_withdraw_collateral_tx
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_anchor_earn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from terra import util_terra
from terra.constants import CUR_AUST, CUR_UST
from terra.handle_simple import handle_unknown
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_failed_tx.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_spend_tx
from terra import util_terra

Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_governance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_reward_tx, make_unknown_tx
from terra import util_terra
from terra.make_tx import make_gov_stake_tx, make_gov_unstake_tx
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_lp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_transfer_in_tx, make_transfer_out_tx
from terra import util_terra
from terra.config_terra import localconfig
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_mirror_borrow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.make_tx import make_borrow_tx, make_repay_tx
from terra import util_terra
from terra.make_tx import make_deposit_collateral_tx, make_withdraw_collateral_tx
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_nft.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from common.ErrorCounter import ErrorCounter
from common.ExporterTypes import TX_TYPE_NFT_WHITELIST
from terra import util_terra
Expand Down
1 change: 0 additions & 1 deletion src/terra/handle_reward.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging

from common.ExporterTypes import (
Expand Down
Loading

0 comments on commit e8fc35d

Please sign in to comment.