Skip to content

Commit 61feaaa

Browse files
committed
feat add code formatting workflow
Signed-off-by: Ricardo Silva <rephyrus0877@protonmail.com>
1 parent b2019ae commit 61feaaa

File tree

15 files changed

+304
-215
lines changed

15 files changed

+304
-215
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: code-formatting
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
branches:
9+
- "**"
10+
11+
jobs:
12+
run-prettier:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: "20"
19+
- run: yarn install
20+
- run: yarn prettier --check .

.github/workflows/publish-to-gh-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
jobs:
1313
publish-to-gh-pages:
14+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v2

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
logo
1313
build
1414
src/external
15+
LICENSE.md
1516

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"insertPragma": false,
88
"singleAttributePerLine": false,
99
"bracketSameLine": false,
10-
"jsxBracketSameLine": false,
1110
"jsxSingleQuote": false,
1211
"printWidth": 80,
1312
"proseWrap": "preserve",
Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
/********************************************************************************
2-
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3-
*
4-
* See the NOTICE file(s) distributed with this work for additional
5-
* information regarding copyright ownership.
6-
*
7-
* This program and the accompanying materials are made available under the
8-
* terms of the Eclipse Public License v. 2.0 which is available at
9-
* http://www.eclipse.org/legal/epl-2.0, or the W3C Software Notice and
10-
*
11-
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513
12-
********************************************************************************/
13-
14-
import React from "react";
15-
import ReactDOM from "react-dom";
16-
17-
interface SpinnerTemplateProps {
18-
fullScreen?: boolean; // overlay ->true, inline component -> false
19-
className?: string;
20-
show?: boolean;
21-
}
22-
23-
const SpinnerTemplate: React.FC<SpinnerTemplateProps> = ({
24-
fullScreen = true,
25-
className = "",
26-
show = true,
27-
}) => {
28-
if (!show) {
29-
return null;
30-
}
31-
32-
const spinnerElement = <Spinner className={className} />;
33-
34-
if (fullScreen) {
35-
return ReactDOM.createPortal(
36-
<div className="bg-transparent-400 absolute left-0 top-0 z-10 flex h-full w-full items-center justify-center text-white">
37-
<div className="bg-transparent-400 flex max-h-screen w-1/3 flex-col items-center justify-center p-4">
38-
<div className="justify-center overflow-hidden p-2">
39-
{spinnerElement}
40-
</div>
41-
</div>
42-
</div>,
43-
document.getElementById("modal-root") as HTMLElement
44-
);
45-
}
46-
47-
return (
48-
<div className={`flex items-center justify-center py-4 ${className}`}>
49-
{spinnerElement}
50-
</div>
51-
);
52-
};
53-
54-
const Spinner: React.FC<{ className?: string }> = ({ className = "" }) => {
55-
return (
56-
<div className={`spinner-container ${className}`}>
57-
<div className="loading-spinner"></div>
58-
</div>
59-
);
60-
};
61-
62-
export { Spinner };
63-
export default SpinnerTemplate;
1+
/********************************************************************************
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License v. 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0, or the W3C Software Notice and
10+
*
11+
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513
12+
********************************************************************************/
13+
14+
import React from "react";
15+
import ReactDOM from "react-dom";
16+
17+
interface SpinnerTemplateProps {
18+
fullScreen?: boolean; // overlay ->true, inline component -> false
19+
className?: string;
20+
show?: boolean;
21+
}
22+
23+
const SpinnerTemplate: React.FC<SpinnerTemplateProps> = ({
24+
fullScreen = true,
25+
className = "",
26+
show = true,
27+
}) => {
28+
if (!show) {
29+
return null;
30+
}
31+
32+
const spinnerElement = <Spinner className={className} />;
33+
34+
if (fullScreen) {
35+
return ReactDOM.createPortal(
36+
<div className="bg-transparent-400 absolute left-0 top-0 z-10 flex h-full w-full items-center justify-center text-white">
37+
<div className="bg-transparent-400 flex max-h-screen w-1/3 flex-col items-center justify-center p-4">
38+
<div className="justify-center overflow-hidden p-2">
39+
{spinnerElement}
40+
</div>
41+
</div>
42+
</div>,
43+
document.getElementById("modal-root") as HTMLElement
44+
);
45+
}
46+
47+
return (
48+
<div className={`flex items-center justify-center py-4 ${className}`}>
49+
{spinnerElement}
50+
</div>
51+
);
52+
};
53+
54+
const Spinner: React.FC<{ className?: string }> = ({ className = "" }) => {
55+
return (
56+
<div className={`spinner-container ${className}`}>
57+
<div className="loading-spinner"></div>
58+
</div>
59+
);
60+
};
61+
62+
export { Spinner };
63+
export default SpinnerTemplate;

src/components/TDViewer/base/BaseButton.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
import React from "react";
1515

16-
interface BaseButtonProps
17-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
16+
interface BaseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
1817
children: React.ReactNode;
1918
variant?: "primary" | "secondary" | "empty";
2019
className?: string;

src/context/GlobalState.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ import React, { ReactNode, useReducer } from "react";
1414

1515
import EdiTDorContext from "./ediTDorContext";
1616
import { editdorReducer } from "./editorReducers";
17-
import {
18-
IValidationMessage,
19-
INorthboundConnection,
20-
IContributeCatalog,
21-
EditorState,
22-
Action,
23-
} from "types/context";
2417

2518
export const UPDATE_OFFLINE_TD = "UPDATE_OFFLINE_TD";
2619
export const UPDATE_IS_MODIFIED = "UPDATE_IS_MODIFIED";

src/context/ediTDorContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513
1212
********************************************************************************/
1313
import React from "react";
14-
import type { IEdiTDorContext } from "../types/context";
1514
// Default
1615
const defaultContext: IEdiTDorContext = {
1716
offlineTD: "",

src/context/editorReducers.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ import type {
2929
FormElementRoot,
3030
FormElementBase,
3131
} from "wot-thing-description-types";
32-
import type {
33-
Action,
34-
EditorState,
35-
IContributeCatalog,
36-
INorthboundConnection,
37-
IValidationMessage,
38-
} from "../types/context";
3932

4033
export const editdorReducer = (
4134
state: EditorState,

src/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@tailwind components;
33
@tailwind utilities;
44

5-
65
html,
76
body,
87
#root {

0 commit comments

Comments
 (0)