forked from pixano/pixano
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (103 loc) · 3.44 KB
/
format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# @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:
- "develop"
- "main"
pull_request:
branches:
- "develop"
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"
version: "~= 24.0"
- name: Format backend tests with black
uses: psf/black@stable
with:
options: "--check --verbose --diff --color"
src: "./tests"
jupyter: true
version: "~= 24.0"
- name: Format Jupyter notebooks with black
uses: psf/black@stable
with:
options: "--check --verbose --diff --color"
src: "./notebooks"
jupyter: true
version: "~= 24.0"