From 1b1745f682c74a55c6eec138432623de7a16f752 Mon Sep 17 00:00:00 2001 From: ross-spencer Date: Tue, 6 Aug 2024 17:23:36 +0200 Subject: [PATCH] README and repo layout --- .codespellrc | 9 ++++++ .editorconfig | 16 ++++++++++ .github/workflows/pre-commit.yml | 14 +++++++++ .gitignore | 6 ++++ .markdownlint.yaml | 12 ++++++++ .pre-commit-config.yaml | 19 ++++++++++++ .vscode/settings.json | 44 ++++++++++++++++++++++++++ Makefile | 15 +++++++++ README.md | 53 ++++++++++++++++++++++++++++++-- 9 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 .codespellrc create mode 100644 .editorconfig create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .gitignore create mode 100644 .markdownlint.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 .vscode/settings.json create mode 100644 Makefile diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..5984f44 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,9 @@ +[codespell] +skip = + *.po, + *.ts, + tests/* +count = +quiet-level = 3 +ignore-words-list = + cips diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6e092a3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig: https://EditorConfig.org. Provides sensible defaults for +# non vscode editors. + +# top-most EditorConfig file +root = true + +# Every file. +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true + +indent_style = space +indent_size = 4 + +trim_trailing_whitespace = true diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..c2f7e71 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6284c20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +.docusaurus +build/ +client/ +node_modules/ +package-lock.json diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..7aed438 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,12 @@ + +--- +default: true + +# Exceptions, example given, MD045 +# MD045: false # allow image with no tag + +# In-line HTML. +MD033: false +MD013: + line_length: 80 + tables: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..62d6644 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + - id: check-json + - id: check-toml + - id: end-of-file-fixer + exclude: ".svg" + - id: trailing-whitespace + - id: check-case-conflict +- repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.35.0 + hooks: + - id: markdownlint +- repo: https://github.com/codespell-project/codespell + rev: v2.2.4 + hooks: + - id: codespell diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ba37acd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,44 @@ +{ + "editor.insertSpaces": true, + "editor.tabSize": 4, + "editor.rulers": [ + 79 + ], + "editor.detectIndentation": false, + "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true, + "python.linting.mypyEnabled": false, + "python.linting.flake8Enabled": true, + "python.linting.pylintEnabled": true, + "python.linting.lintOnSave": true, + "git.inputValidationSubjectLength": 50, + "git.inputValidationLength": 72, + "[git-commit]": { + "editor.rulers": [ + 50, + 72 + ] + }, + "[markdown]": { + "editor.rulers": [80] + }, + "files.eol": "\n", + "cSpell.words": [ + "Arkly", + "Bagit", + "Cardano", + "CBOR", + "datapoints", + "disincentivizing", + "Minswap", + "permissionless", + "permissionlessly", + "POSIX", + "preprod", + "recordkeeping", + "Wingriders", + "bytearray", + "timeframe", + "pubkey" + ] +} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..87cdde6 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.DEFAULT_GOAL := help + +.PHONY: clean package package-deps package-source package-upload package-wheel tar-source + +all-checks: ## Run all pre-commit checks + pre-commit run --all-files + +spell: ## Run pre-commit spelling check + pre-commit run codespell --all-files + +markdown: ## Run pre-commit makdown-lint + pre-commit run markdownlint --all-files + +help: ## Print this help message + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/README.md b/README.md index e0fd1b7..94beb07 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,51 @@ -# price-feeds -active Orcfax price-feeds +# Price Feeds + +Describes active Orcfax feeds for Orcfax publishing and monitoring. + +## Status + +The document and repository are proposed standards for the Orcfax network for +the V1 rollout. We reserve the right to change the status and its content as our +network and client needs are better understood. + +## Schema + + + +* **pair**: pair as described in-code, e.g. for the slug needed to trigger validation +* **label**: presentation label, e.g. for Orcfax explorer +* **interval**: heartbeat, in seconds, integer +* **deviation**: percentage deviation to monitor, integer, ex. `1` == `1%` +* **source**: ( `cex` | `dex` ) +* **calculation**: ( `median` | `weighted mean` ) +* **status**: (`sponsored` | `subsidized` | `showcase`) +* **type**: (`CER` ) `CER` == `currencyExchangeRate` + + + +Order of keys does not matter to JSON parsers, but it might provide important +visual cues to reviewers to maintain some consistency of ordering in this +document. + +### Example + +```json + { + "pair": "BASE-QUOTE", + "label": "BASE-QUOTE", + "interval": 3600, + "deviation": 2, + "source": "dex", + "calculation": "weighted mean", + "status": "showcase", + "type": "CER" + }, +``` + +## Versioning + +Calver is proposed. Changes should be made to the document locally. The metadata +should be updated with the anticipated calver number (`YYYY.MM.DD.NUMBER`) where +NUMBER represents the number of the release on a given day, e.g. if a feed is +updated twice in one day, the number will be `0002`. A tag should be created +and pushed for the version as part of publishing.