Skip to content

Commit

Permalink
style: consistent code formatting
Browse files Browse the repository at this point in the history
- Format Python code using black
- Format html, css, js files using prettier
- Add CI jobs to enforce consistent code formatting

Signed-off-by: Michael Adler <[email protected]>
  • Loading branch information
michaeladler authored and fmoessbauer committed Nov 13, 2024
1 parent 84fd3b2 commit 2ed48b9
Show file tree
Hide file tree
Showing 9 changed files with 352 additions and 269 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,25 @@ jobs:

- name: install dependencies
run: |
sudo apt-get update && sudo apt-get install -y python3-gi flake8 pylint python3-pydbus
sudo apt-get update && sudo apt-get install -y python3-gi flake8 pylint python3-pydbus black
pip3 install --break-system-packages fsfe-reuse
git clean -f -d
- name: execute linters
run: |
reuse lint
flake8
flake8 --max-line-length=88
pylint linux-entra-sso.py
- name: check Python code formatting
run: black --diff --check .

- name: run prettier
uses: creyD/[email protected]
with:
dry: true
prettier_options: '--check **/*.{js,html,css}'

build-xpi:
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 4
}
2 changes: 2 additions & 0 deletions .prettierrc.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: MPL-2.0
# SPDX-FileCopyrightText: Copyright (c) Siemens AG, 2024
Loading

0 comments on commit 2ed48b9

Please sign in to comment.