Skip to content

Commit

Permalink
chore: add prettier check to CI, format files, upgrade prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
vacekj committed Jul 20, 2023
1 parent b2a19a9 commit 77854e5
Show file tree
Hide file tree
Showing 234 changed files with 2,054 additions and 1,772 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/global.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Global Checks
on:
push:
branches:
- main
pull_request:
branches:
- "**"
jobs:
build-and-deploy:
concurrency: ci-round-manager-${{ github.head_ref || github.run_id }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: pnpm/action-setup@v2
with:
version: 7

- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'pnpm'

- name: Install Dependencies
run: |
pnpm install
- name: Check formatting
run: |
pnpm format:check
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"compile": "pnpm --filter contracts run compile ",
"test": "pnpm run test",
"typecheck": "turbo run typecheck",
"format:check": "pnpm -r --filter=\\!eslint-config-gitcoin exec prettier --check .",
"// round manager script": "====== packages/round-manager specific ======",
"rm-build": "pnpm --filter round-manager run build",
"rm-test": "pnpm --filter round-manager run test",
Expand Down
5 changes: 5 additions & 0 deletions packages/builder/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package.json
node_modules
coverage
build
public
1 change: 1 addition & 0 deletions packages/builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This serves as the UI for publishing products to the project registry contracts

## Usage

Usage instructions

### Pre Requisites
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@
"lokijs": "^1.5.12",
"msw": "^0.47.4",
"postcss-import": "^14.1.0",
"prettier": "^2.6.2"
"prettier": "^3.0.0"
}
}
76 changes: 38 additions & 38 deletions packages/builder/src/__tests__/components/application/Form.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ describe("<Form />", () => {
onSubmit={jest.fn()}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand All @@ -155,10 +155,10 @@ describe("<Form />", () => {
const addressInputWrapper = screen.getByTestId("address-input-wrapper");
const walletTypeWrapper = screen.getByTestId("wallet-type");
const isSafeOption = walletTypeWrapper.querySelector(
'input[value="Yes"]'
'input[value="Yes"]',
) as Element;
const addressInput = addressInputWrapper.querySelector(
"input"
"input",
) as Element;

await act(async () => {
Expand All @@ -173,8 +173,8 @@ describe("<Form />", () => {
expect(
screen
.getByTestId("address-input-wrapper")
.querySelector("input.border")
).toBeNull()
.querySelector("input.border"),
).toBeNull(),
);
});

Expand All @@ -197,11 +197,11 @@ describe("<Form />", () => {
onSubmit={jest.fn()}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand All @@ -211,10 +211,10 @@ describe("<Form />", () => {
const addressInputWrapper = screen.getByTestId("address-input-wrapper");
const walletTypeWrapper = screen.getByTestId("wallet-type");
const isSafeOption = walletTypeWrapper.querySelector(
'input[value="No"]'
'input[value="No"]',
) as Element;
const addressInput = addressInputWrapper.querySelector(
"input"
"input",
) as Element;

await act(async () => {
Expand All @@ -228,9 +228,9 @@ describe("<Form />", () => {
expect(
screen.getByText(
// eslint-disable-next-line max-len
"It looks like the payout wallet address you have provided is a multi-sig. Please update your selection to indicate your payout wallet address will be a multi-sig, or update your payout wallet address."
)
).toBeInTheDocument()
"It looks like the payout wallet address you have provided is a multi-sig. Please update your selection to indicate your payout wallet address will be a multi-sig, or update your payout wallet address.",
),
).toBeInTheDocument(),
);
});

Expand All @@ -253,11 +253,11 @@ describe("<Form />", () => {
onSubmit={jest.fn()}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand All @@ -267,10 +267,10 @@ describe("<Form />", () => {
const addressInputWrapper = screen.getByTestId("address-input-wrapper");
const walletTypeWrapper = screen.getByTestId("wallet-type");
const isSafeOption = walletTypeWrapper.querySelector(
'input[value="Yes"]'
'input[value="Yes"]',
) as Element;
const addressInput = addressInputWrapper.querySelector(
"input"
"input",
) as Element;

await act(async () => {
Expand All @@ -284,9 +284,9 @@ describe("<Form />", () => {
expect(
screen.getByText(
// eslint-disable-next-line max-len
"It looks like the payout wallet address you have provided may not be a valid multi-sig on the Goerli network. Please update your payout wallet address before proceeding."
)
).toBeInTheDocument()
"It looks like the payout wallet address you have provided may not be a valid multi-sig on the Goerli network. Please update your payout wallet address before proceeding.",
),
).toBeInTheDocument(),
);
});

Expand All @@ -309,11 +309,11 @@ describe("<Form />", () => {
onSubmit={jest.fn()}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand All @@ -323,10 +323,10 @@ describe("<Form />", () => {
const addressInputWrapper = screen.getByTestId("address-input-wrapper");
const walletTypeWrapper = screen.getByTestId("wallet-type");
const isSafeOption = walletTypeWrapper.querySelector(
'input[value="No"]'
'input[value="No"]',
) as Element;
const addressInput = addressInputWrapper.querySelector(
"input"
"input",
) as Element;

await act(async () => {
Expand All @@ -340,8 +340,8 @@ describe("<Form />", () => {
expect(
screen
.getByTestId("address-input-wrapper")
.querySelector("input.border")
).toBeNull()
.querySelector("input.border"),
).toBeNull(),
);

// await waitFor(() =>
Expand All @@ -362,11 +362,11 @@ describe("<Form />", () => {
onSubmit={jest.fn()}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand Down Expand Up @@ -431,11 +431,11 @@ describe("<Form/>", () => {
onSubmit={jest.fn()}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand All @@ -444,11 +444,11 @@ describe("<Form/>", () => {
});

expect(
screen.getByText("Project Twitter is required.")
screen.getByText("Project Twitter is required."),
).toBeInTheDocument();

expect(
screen.queryByText("Project Github is required.")
screen.queryByText("Project Github is required."),
).not.toBeInTheDocument();
});
});
Expand Down Expand Up @@ -512,11 +512,11 @@ describe("Form questions", () => {
onChange={onChange}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand Down Expand Up @@ -575,11 +575,11 @@ describe("Form questions", () => {
onChange={onChange}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand Down Expand Up @@ -638,11 +638,11 @@ describe("Form questions", () => {
onChange={onChange}
showErrorModal={false}
/>,
store
store,
);

const selectProject = screen.getByLabelText(
"Select a project you would like to apply for funding:"
"Select a project you would like to apply for funding:",
);
await act(async () => {
fireEvent.change(selectProject, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ describe("<CustomerSupport />", () => {
render(<CustomerSupport />);
const customerSupport = screen.getByTestId("customer-support");
const customerSupportButton = customerSupport.querySelector(
"button"
"button",
) as Element;

act(() => {
customerSupportButton.dispatchEvent(
new MouseEvent("click", { bubbles: true })
new MouseEvent("click", { bubbles: true }),
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe("<StatusModal /> with applicationSteps", () => {
: undefined
}
/>,
setupStore()
setupStore(),
);
});

Expand All @@ -175,7 +175,7 @@ describe("<StatusModal /> with applicationSteps", () => {
const iconElement = stepElement.querySelector(".step-icon")!;
const expectedIcon = scenario.icons[index];
expect(
iconElement.classList.contains(`step-icon-${expectedIcon}`)
iconElement.classList.contains(`step-icon-${expectedIcon}`),
).toEqual(true);
});
});
Expand Down Expand Up @@ -250,7 +250,7 @@ describe("<StatusModal /> with grantSteps", () => {
: undefined
}
/>,
setupStore()
setupStore(),
);
});

Expand All @@ -260,7 +260,7 @@ describe("<StatusModal /> with grantSteps", () => {
const iconElement = stepElement.querySelector(".step-icon")!;
const expectedIcon = scenario.icons[index];
expect(
iconElement.classList.contains(`step-icon-${expectedIcon}`)
iconElement.classList.contains(`step-icon-${expectedIcon}`),
).toEqual(true);
});
});
Expand Down
Loading

0 comments on commit 77854e5

Please sign in to comment.