diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index ef3c017..7b56264 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -151,3 +151,33 @@ jobs: run: poetry install --no-interaction - name: ๐Ÿš€ Run yamllint run: poetry run yamllint . + + prettier: + name: Prettier + runs-on: ubuntu-latest + steps: + - name: โคต๏ธ Check out code from GitHub + uses: actions/checkout@v4.1.1 + - name: ๐Ÿ— Set up Poetry + run: pipx install poetry + - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v5.0.0 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + cache: "poetry" + - name: ๐Ÿ— Install workflow dependencies + run: | + poetry config virtualenvs.create true + poetry config virtualenvs.in-project true + - name: ๐Ÿ— Install Python dependencies + run: poetry install --no-interaction + - name: ๐Ÿ— Set up Node.js + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4 + with: + node-version-file: ".nvmrc" + cache: "npm" + - name: ๐Ÿ— Install NPM dependencies + run: npm install + - name: ๐Ÿš€ Run prettier + run: poetry run pre-commit run prettier --all-files diff --git a/.gitignore b/.gitignore index 68bc17f..06c3d07 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,5 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +node_modules/ diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8b0beab --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.11.0 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..6c7b69a --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +.gitignore diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ad7297f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,31 @@ +{ + "name": "aioelectricitymaps", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "aioelectricitymaps", + "version": "0.0.0", + "license": "MIT", + "devDependencies": { + "prettier": "3.2.4" + } + }, + "node_modules/prettier": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..7e05cdd --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "aioelectricitymaps", + "version": "0.0.0", + "private": true, + "description": "Asynchronous Python client for Electricity Maps.", + "scripts": { + "prettier": "prettier --write **/*.{json,js,md,yml,yaml}" + }, + "author": "Jan-Philipp Benecke ", + "license": "MIT", + "devDependencies": { + "prettier": "3.2.4" + } +} diff --git a/poetry.lock b/poetry.lock index 25b9dd9..bcd2a79 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1241,4 +1241,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.10,<4" -content-hash = "297ab8c367dfcabe580cfd091f7cb777af0ec3fbeb56b38531a1119fe17cc056" +content-hash = "6e0ee31d59a3de13239132d9c97e7d9b62a72e5842c4925fb7b4901111bdb086"