-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from FullStackWithLawrence/next
add ESLint, PyLint, prettier, black, flake8, isort to pre-commit
- Loading branch information
Showing
143 changed files
with
3,974 additions
and
3,617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: ["standard-with-typescript", "plugin:react/recommended"], | ||
overrides: [ | ||
{ | ||
env: { | ||
node: true, | ||
}, | ||
files: [".eslintrc.{js,cjs}"], | ||
parserOptions: { | ||
sourceType: "script", | ||
}, | ||
}, | ||
], | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
}, | ||
plugins: ["react"], | ||
rules: { | ||
"react/jsx-uses-react": "error", | ||
"react/jsx-uses-vars": "error", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length = 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,59 @@ | ||
--- | ||
#------------------------------------------------------------------------------ | ||
# Run pre-commit | ||
#------------------------------------------------------------------------------ | ||
name: Merge | ||
branding: | ||
icon: 'git-pull-request' | ||
color: 'orange' | ||
icon: "git-pull-request" | ||
color: "orange" | ||
inputs: | ||
github-token: | ||
description: 'The GitHub token to use for authentication' | ||
description: "The GitHub token to use for authentication" | ||
required: true | ||
type: string | ||
source-branch: | ||
description: 'The branch to merge from' | ||
description: "The branch to merge from" | ||
required: false | ||
type: string | ||
default: 'main' | ||
default: "main" | ||
target-branch: | ||
description: 'The branch to merge to' | ||
description: "The branch to merge to" | ||
required: true | ||
type: string | ||
|
||
python-version: | ||
description: 'The version of Python to use, such as 3.11.0' | ||
description: "The version of Python to use, such as 3.11.0" | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout code | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Checkout code | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Remember current branch | ||
shell: bash | ||
run: | | ||
echo "CURRENT_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV | ||
- name: Remember current branch | ||
shell: bash | ||
run: | | ||
echo "CURRENT_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV | ||
- name: Merge | ||
id: merge | ||
shell: bash | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git checkout ${{ inputs.source-branch }} | ||
git pull | ||
git checkout ${{ inputs.target-branch }} | ||
git merge -Xtheirs ${{ inputs.source-branch }} | ||
git push https://${{ inputs.github-token }}@github.com/${{ github.repository }}.git HEAD:${{ inputs.target-branch }} | ||
- name: Merge | ||
id: merge | ||
shell: bash | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git checkout ${{ inputs.source-branch }} | ||
git pull | ||
git checkout ${{ inputs.target-branch }} | ||
git merge -Xtheirs ${{ inputs.source-branch }} | ||
git push https://${{ inputs.github-token }}@github.com/${{ github.repository }}.git HEAD:${{ inputs.target-branch }} | ||
- name: Checkout current branch | ||
shell: bash | ||
run: | | ||
git checkout ${{ env.CURRENT_BRANCH }} | ||
- name: Checkout current branch | ||
shell: bash | ||
run: | | ||
git checkout ${{ env.CURRENT_BRANCH }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,69 @@ | ||
--- | ||
#------------------------------------------------------------------------------ | ||
# Run pre-commit | ||
#------------------------------------------------------------------------------ | ||
name: Test pre-commit | ||
branding: | ||
icon: 'git-pull-request' | ||
color: 'orange' | ||
icon: "git-pull-request" | ||
color: "orange" | ||
inputs: | ||
python-version: | ||
description: 'The version of Python to use, such as 3.11.0' | ||
description: "The version of Python to use, such as 3.11.0" | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout code | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
- name: Checkout code | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for pre-commit in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "pre-commit" ./requirements.txt; then | ||
echo "pre-commit not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Check for pre-commit in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "pre-commit" ./requirements.txt; then | ||
echo "pre-commit not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Check for black in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "black" ./requirements.txt; then | ||
echo "black not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Check for black in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "black" ./requirements.txt; then | ||
echo "black not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Check for flake8 in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "flake8" ./requirements.txt; then | ||
echo "flake8 not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Check for flake8 in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "flake8" ./requirements.txt; then | ||
echo "flake8 not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Check for flake8-coding in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "flake8-coding" ./requirements.txt; then | ||
echo "flake8-coding not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Check for flake8-coding in requirements | ||
shell: bash | ||
run: | | ||
if ! grep -q "flake8-coding" ./requirements.txt; then | ||
echo "flake8-coding not found in requirements.txt" >&2 | ||
exit 1 | ||
fi | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r ./requirements.txt | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r ./requirements.txt | ||
# see: https://pre-commit.ci/lite.html | ||
- name: pre-commit ci | ||
id: pre-commit-ci | ||
if: always() | ||
uses: pre-commit-ci/[email protected] | ||
# see: https://pre-commit.ci/lite.html | ||
- name: pre-commit ci | ||
id: pre-commit-ci | ||
if: always() | ||
uses: pre-commit-ci/[email protected] |
Oops, something went wrong.