forked from pixano/pixano
-
Notifications
You must be signed in to change notification settings - Fork 0
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 pixano#26 from pixano/chore/lint_backend
feat(ci): Add backend linting
- Loading branch information
Showing
59 changed files
with
1,706 additions
and
1,181 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,18 @@ | ||
[MASTER] | ||
disable= | ||
C0114, # missing-module-docstring | ||
C0301, # line-too-long (already set by black formatter) | ||
R0903, # too-few-public-methods (PixanoType CustomExtensionType and Scalar, Exporter) | ||
generated-members= | ||
cv2.*, # members not found | ||
duckdb.*, # members not found | ||
|
||
[MAIN] | ||
max-branches=20 | ||
|
||
[DESIGN] | ||
max-args = 10 | ||
max-locals = 20 | ||
|
||
[SIMILARITIES] | ||
min-similarity-lines=10 |
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,112 @@ | ||
# @Copyright: CEA-LIST/DIASI/SIALV/LVA (2023) | ||
# @Author: CEA-LIST/DIASI/SIALV/LVA <[email protected]> | ||
# @License: CECILL-C | ||
# | ||
# This software is a collaborative computer program whose purpose is to | ||
# generate and explore labeled data for computer vision applications. | ||
# This software is governed by the CeCILL-C license under French law and | ||
# abiding by the rules of distribution of free software. You can use, | ||
# modify and/ or redistribute the software under the terms of the CeCILL-C | ||
# license as circulated by CEA, CNRS and INRIA at the following URL | ||
# | ||
# http://www.cecill.info | ||
|
||
name: Format | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
pull_request: | ||
branches: | ||
- "develop" | ||
- "main" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# This workflow will format frontend code (Svelte, Typescript) and project files (Markdown, YAML) with Prettier | ||
|
||
format_front: | ||
name: Frontend | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd ui | ||
pnpm i | ||
- name: Format frontend code with Prettier | ||
run: | | ||
cd ui | ||
pnpm format_check | ||
- name: Format top-level Markdown and YAML files with Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check ./*.{md,yml} | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
|
||
- name: Format GitHub actions YAML files with Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check ./.github/workflows/*.yml | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
|
||
- name: Format docs Markdown files with Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check ./docs/**/*.md | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
|
||
- name: Format backend Markdown files with Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check ./pixano/**/*.md | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
|
||
# This job will format backend code (Python) and notebooks (Jupyter) with black | ||
# For more information see: https://black.readthedocs.io/en/stable/integrations/github_actions.html | ||
format_back: | ||
name: Backend | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Format backend code with black | ||
uses: psf/black@stable | ||
with: | ||
options: "--check --verbose --diff --color" | ||
src: "./pixano" | ||
|
||
- name: Format notebooks with black | ||
uses: psf/black@stable | ||
with: | ||
options: "--check --verbose --diff --color" | ||
src: "./notebooks" | ||
jupyter: true |
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
# | ||
# http://www.cecill.info | ||
|
||
name: Lint code | ||
name: Lint | ||
|
||
on: | ||
push: | ||
|
@@ -26,8 +26,8 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
# This workflow will lint frontend code (Svelte, Typescript) code with eslint and Prettier | ||
ui_lint: | ||
# This workflow will lint frontend code (Svelte, Typescript) with eslint | ||
lint_front: | ||
name: Frontend | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -50,87 +50,35 @@ jobs: | |
cd ui | ||
pnpm i | ||
- name: Lint frontend code with Prettier | ||
run: | | ||
cd ui | ||
pnpm format_check | ||
- name: Lint frontend code with eslint | ||
run: | | ||
cd ui | ||
pnpm lint | ||
# This job will lint backend code (Python) with black | ||
# For more information see: https://black.readthedocs.io/en/stable/integrations/github_actions.html | ||
python_lint: | ||
# This job will lint backend code (Python) with Pylint | ||
# Disable R0801 (duplicate-code) for backend tests as we reuse some code like sample statistics and importers basic tests | ||
lint_back: | ||
name: Backend | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Lint Python code with black | ||
uses: psf/black@stable | ||
with: | ||
options: "--check --verbose --diff --color" | ||
src: "./pixano" | ||
|
||
# This job will lint notebooks code (Jupyter) with black | ||
# For more information see: https://black.readthedocs.io/en/stable/integrations/github_actions.html | ||
jupyter_lint: | ||
name: Notebooks | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Lint Jupyter notebooks with black | ||
uses: psf/black@stable | ||
with: | ||
options: "--check --verbose --diff --color" | ||
src: "./notebooks" | ||
jupyter: true | ||
|
||
# This workflow will lint the rest of the code (Mardown, YAML, JSON) with Prettier | ||
# For more information see: https://github.com/marketplace/actions/prettier-action | ||
other_lint: | ||
name: Other | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Lint top-level Markdown and YAML files with Prettier | ||
uses: creyD/[email protected] | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
dry: True | ||
prettier_options: --check ./*.{md,yml} | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
python-version: "3.10" | ||
|
||
- name: Lint GitHub actions with Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check ./.github/workflows/*.yml | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
|
||
- name: Lint docs with Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check ./docs/**/*.md | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install . | ||
python -m pip install pylint | ||
python -m pip install pixano-inference@git+https://github.com/pixano/pixano-inference | ||
- name: Lint Python READMEs with Prettier | ||
uses: creyD/[email protected] | ||
with: | ||
dry: True | ||
prettier_options: --check ./pixano/**/*.md | ||
# Prettier 3.0 not yet available in VSCode extension | ||
prettier_version: 2.8.8 | ||
- name: Lint backend code with Pylint | ||
run: | | ||
pylint pixano/ --rcfile .github/workflows/.pylintrc | ||
pylint notebooks/ --rcfile .github/workflows/.pylintrc | ||
pylint tests/ --rcfile .github/workflows/.pylintrc --disable=R0801 |
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
# | ||
# http://www.cecill.info | ||
|
||
name: Test code | ||
name: Test | ||
|
||
on: | ||
push: | ||
|
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
Oops, something went wrong.