From 4a05f97e3aa023bff7ea29f2ba6b246e500e1b9e Mon Sep 17 00:00:00 2001 From: Emily Price Date: Sat, 16 Nov 2024 21:38:35 +0000 Subject: [PATCH 1/3] Correct use of DataPoint in getting started --- docs/source/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/getting-started.rst b/docs/source/getting-started.rst index fe64f2a..ffab177 100644 --- a/docs/source/getting-started.rst +++ b/docs/source/getting-started.rst @@ -1,7 +1,7 @@ Getting started =============== -Getting started with DataPoint for Python is simple and you can write a +Getting started with DataHub for Python is simple and you can write a simple script which prints out data in just 6 lines of Python. API Key From 851101c0a29a0997d2b5e9989e32677912982b7c Mon Sep 17 00:00:00 2001 From: Emily Price Date: Sat, 16 Nov 2024 21:41:47 +0000 Subject: [PATCH 2/3] Move docs conf to correct location --- docs/{source => }/conf.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{source => }/conf.py (100%) diff --git a/docs/source/conf.py b/docs/conf.py similarity index 100% rename from docs/source/conf.py rename to docs/conf.py From 6f10ea65f3ed9842d17dee3cb3925cb3bec12df4 Mon Sep 17 00:00:00 2001 From: Emily Price Date: Sat, 16 Nov 2024 21:42:07 +0000 Subject: [PATCH 3/3] Add linting action and pre-commit config --- .github/workflows/lint.yaml | 45 +++++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 24 ++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/lint.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..8d1d3cc --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,45 @@ +name: Lint +on: + pull_request: + branches: + - "master" +jobs: + black: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + - name: Install and run linter + run: | + pip install black==22.10.0 + black --check --verbose --diff --color -S . + isort: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + - name: Install and run linter + run: | + pip install isort==5.13.2 + isort . --check-only --diff + flake8: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + - name: Install and run linter + run: | + pip install flake8==7.1.0 flake8-bugbear + flake8 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4092262 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + - repo: https://github.com/pycqa/flake8 + rev: 7.1.0 + hooks: + - id: flake8 + additional_dependencies: + - flake8-bugbear==24.2.6 + - repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black