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 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 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