Skip to content

Commit 85c6795

Browse files
authored
site: reduce printWidth to 80 (#4437)
Resolves #4435
1 parent cb54986 commit 85c6795

File tree

274 files changed

+3240
-1175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+3240
-1175
lines changed

site/.prettierrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
2-
"printWidth": 100,
2+
"printWidth": 80,
33
"semi": false,
44
"trailingComma": "all",
55
"overrides": [
66
{
77
"files": ["./README.md", "**/*.yaml"],
88
"options": {
9-
"printWidth": 80,
109
"proseWrap": "always"
1110
}
1211
}

site/.storybook/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ module.exports = {
3939
//
4040
// SEE: https://storybook.js.org/docs/react/configure/webpack
4141
webpackFinal: async (config) => {
42-
config.resolve.modules = [path.resolve(__dirname, ".."), "node_modules", "../src"]
42+
config.resolve.modules = [
43+
path.resolve(__dirname, ".."),
44+
"node_modules",
45+
"../src",
46+
]
4347
return config
4448
},
4549
}

site/e2e/pom/SignInPage.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ export class SignInPage extends BasePom {
66
super(baseURL, "/login", page)
77
}
88

9-
async submitBuiltInAuthentication(email: string, password: string): Promise<void> {
9+
async submitBuiltInAuthentication(
10+
email: string,
11+
password: string,
12+
): Promise<void> {
1013
await this.page.fill("text=Email", email)
1114
await this.page.fill("text=Password", password)
1215
await this.page.click("text=Sign In")

site/e2e/tests/healthz.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { test } from "@playwright/test"
22
import { HealthzPage } from "../pom/HealthzPage"
33

4-
test("Healthz is available without authentication", async ({ baseURL, page }) => {
4+
test("Healthz is available without authentication", async ({
5+
baseURL,
6+
page,
7+
}) => {
58
const healthzPage = new HealthzPage(baseURL, page)
69
await page.goto(healthzPage.url, { waitUntil: "networkidle" })
710
await healthzPage.getOk().waitFor({ state: "visible" })

site/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323
href="/favicons/favicon.png"
2424
data-react-helmet="true"
2525
/>
26-
<link rel="icon" type="image/svg+xml" href="/favicons/favicon.svg" data-react-helmet="true" />
26+
<link
27+
rel="icon"
28+
type="image/svg+xml"
29+
href="/favicons/favicon.svg"
30+
data-react-helmet="true"
31+
/>
2732
</head>
2833

2934
<body>

site/jest.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,17 @@ module.exports = {
3535
{
3636
displayName: "lint",
3737
runner: "jest-runner-eslint",
38-
testMatch: ["<rootDir>/**/*.js", "<rootDir>/**/*.ts", "<rootDir>/**/*.tsx"],
39-
testPathIgnorePatterns: ["/out/", "/_jest/", "jest.config.js", "jest-runner.*.js"],
38+
testMatch: [
39+
"<rootDir>/**/*.js",
40+
"<rootDir>/**/*.ts",
41+
"<rootDir>/**/*.tsx",
42+
],
43+
testPathIgnorePatterns: [
44+
"/out/",
45+
"/_jest/",
46+
"jest.config.js",
47+
"jest-runner.*.js",
48+
],
4049
},
4150
],
4251
collectCoverageFrom: [

site/jest.setup.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ const CONSOLE_FAIL_TYPES = ["error" /* 'warn' */] as const
4545
CONSOLE_FAIL_TYPES.forEach((logType: typeof CONSOLE_FAIL_TYPES[number]) => {
4646
global.console[logType] = <Type>(format: string, ...args: Type[]): void => {
4747
throw new Error(
48-
`Failing due to console.${logType} while running test!\n\n${util.format(format, ...args)}`,
48+
`Failing due to console.${logType} while running test!\n\n${util.format(
49+
format,
50+
...args,
51+
)}`,
4952
)
5053
}
5154
})

site/src/AppRouter.tsx

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,42 @@ import { SettingsLayout } from "./components/SettingsLayout/SettingsLayout"
2323
// - Pages that are secondary, not in the main navigation or not usually accessed
2424
// - Pages that use heavy dependencies like charts or time libraries
2525
const NotFoundPage = lazy(() => import("./pages/404Page/404Page"))
26-
const CliAuthenticationPage = lazy(() => import("./pages/CliAuthPage/CliAuthPage"))
26+
const CliAuthenticationPage = lazy(
27+
() => import("./pages/CliAuthPage/CliAuthPage"),
28+
)
2729
const HealthzPage = lazy(() => import("./pages/HealthzPage/HealthzPage"))
28-
const AccountPage = lazy(() => import("./pages/UserSettingsPage/AccountPage/AccountPage"))
29-
const SecurityPage = lazy(() => import("./pages/UserSettingsPage/SecurityPage/SecurityPage"))
30-
const SSHKeysPage = lazy(() => import("./pages/UserSettingsPage/SSHKeysPage/SSHKeysPage"))
31-
const CreateUserPage = lazy(() => import("./pages/UsersPage/CreateUserPage/CreateUserPage"))
32-
const WorkspaceBuildPage = lazy(() => import("./pages/WorkspaceBuildPage/WorkspaceBuildPage"))
30+
const AccountPage = lazy(
31+
() => import("./pages/UserSettingsPage/AccountPage/AccountPage"),
32+
)
33+
const SecurityPage = lazy(
34+
() => import("./pages/UserSettingsPage/SecurityPage/SecurityPage"),
35+
)
36+
const SSHKeysPage = lazy(
37+
() => import("./pages/UserSettingsPage/SSHKeysPage/SSHKeysPage"),
38+
)
39+
const CreateUserPage = lazy(
40+
() => import("./pages/UsersPage/CreateUserPage/CreateUserPage"),
41+
)
42+
const WorkspaceBuildPage = lazy(
43+
() => import("./pages/WorkspaceBuildPage/WorkspaceBuildPage"),
44+
)
3345
const WorkspacePage = lazy(() => import("./pages/WorkspacePage/WorkspacePage"))
3446
const WorkspaceSchedulePage = lazy(
3547
() => import("./pages/WorkspaceSchedulePage/WorkspaceSchedulePage"),
3648
)
3749
const TerminalPage = lazy(() => import("./pages/TerminalPage/TerminalPage"))
38-
const CreateWorkspacePage = lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))
50+
const CreateWorkspacePage = lazy(
51+
() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"),
52+
)
3953
const TemplatePage = lazy(() => import("./pages/TemplatePage/TemplatePage"))
4054

4155
export const AppRouter: FC = () => {
4256
const xServices = useContext(XServiceContext)
4357
const permissions = useSelector(xServices.authXService, selectPermissions)
44-
const featureVisibility = useSelector(xServices.entitlementsXService, selectFeatureVisibility)
58+
const featureVisibility = useSelector(
59+
xServices.entitlementsXService,
60+
selectFeatureVisibility,
61+
)
4562

4663
return (
4764
<Suspense fallback={<FullScreenLoader />}>
@@ -142,7 +159,8 @@ export const AppRouter: FC = () => {
142159
<AuthAndFrame>
143160
<RequirePermission
144161
isFeatureVisible={
145-
featureVisibility[FeatureNames.AuditLog] && Boolean(permissions?.viewAuditLog)
162+
featureVisibility[FeatureNames.AuditLog] &&
163+
Boolean(permissions?.viewAuditLog)
146164
}
147165
>
148166
<AuditPage />

site/src/Main.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import "./i18n"
66

77
// if this is a development build and the developer wants to inspect
88
// helpful to see realtime changes on the services
9-
if (process.env.NODE_ENV === "development" && process.env.INSPECT_XSTATE === "true") {
9+
if (
10+
process.env.NODE_ENV === "development" &&
11+
process.env.INSPECT_XSTATE === "true"
12+
) {
1013
// configure the XState inspector to open in a new tab
1114
inspect({
1215
url: "https://stately.ai/viz?inspect",

site/src/api/api.test.ts

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,39 @@ describe("api.ts", () => {
119119
["/api/v2/workspaces", undefined, "/api/v2/workspaces"],
120120

121121
["/api/v2/workspaces", { q: "" }, "/api/v2/workspaces"],
122-
["/api/v2/workspaces", { q: "owner:1" }, "/api/v2/workspaces?q=owner%3A1"],
123-
124-
["/api/v2/workspaces", { q: "owner:me" }, "/api/v2/workspaces?q=owner%3Ame"],
125-
])(`Workspaces - getURLWithSearchParams(%p, %p) returns %p`, (basePath, filter, expected) => {
126-
expect(getURLWithSearchParams(basePath, filter)).toBe(expected)
127-
})
122+
[
123+
"/api/v2/workspaces",
124+
{ q: "owner:1" },
125+
"/api/v2/workspaces?q=owner%3A1",
126+
],
127+
128+
[
129+
"/api/v2/workspaces",
130+
{ q: "owner:me" },
131+
"/api/v2/workspaces?q=owner%3Ame",
132+
],
133+
])(
134+
`Workspaces - getURLWithSearchParams(%p, %p) returns %p`,
135+
(basePath, filter, expected) => {
136+
expect(getURLWithSearchParams(basePath, filter)).toBe(expected)
137+
},
138+
)
128139
})
129140

130141
describe("getURLWithSearchParams - users", () => {
131142
it.each<[string, TypesGen.UsersRequest | undefined, string]>([
132143
["/api/v2/users", undefined, "/api/v2/users"],
133-
["/api/v2/users", { q: "status:active" }, "/api/v2/users?q=status%3Aactive"],
144+
[
145+
"/api/v2/users",
146+
{ q: "status:active" },
147+
"/api/v2/users?q=status%3Aactive",
148+
],
134149
["/api/v2/users", { q: "" }, "/api/v2/users"],
135-
])(`Users - getURLWithSearchParams(%p, %p) returns %p`, (basePath, filter, expected) => {
136-
expect(getURLWithSearchParams(basePath, filter)).toBe(expected)
137-
})
150+
])(
151+
`Users - getURLWithSearchParams(%p, %p) returns %p`,
152+
(basePath, filter, expected) => {
153+
expect(getURLWithSearchParams(basePath, filter)).toBe(expected)
154+
},
155+
)
138156
})
139157
})

0 commit comments

Comments
 (0)