Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier config #38

Merged
merged 9 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prettier formatting errors
32743cbd2f5dead77fd6ef7be25105f33c370f29
eriktaubeneck marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ repos:
files: ^server/
types_or: [javascript, jsx, ts, tsx]
pass_filenames: false
- id: prettier
name: prettier
entry: npx --prefix server prettier --config=server/.prettierrc --ignore-path=server/.prettierignore --check server
language: system
files: ^server/
types_or: [javascript, jsx, ts, tsx]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Requirements:
3. [Supabase CLI](https://supabase.com/docs/guides/cli/getting-started)
4. Docker

#### Pre-commit Hooks

Github is setup to run pre-commit hooks specified in .pre-commit-config.yaml. If you want to use it locally, in the virtual environment, run `pre-commit install`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the grammatical error for clarity.

- Github is setup to run pre-commit hooks specified in .pre-commit-config.yaml.
+ Github is set up to run pre-commit hooks specified in .pre-commit-config.yaml.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Github is setup to run pre-commit hooks specified in .pre-commit-config.yaml. If you want to use it locally, in the virtual environment, run `pre-commit install`.
Github is set up to run pre-commit hooks specified in .pre-commit-config.yaml. If you want to use it locally, in the virtual environment, run `pre-commit install`.
Tools
LanguageTool

[grammar] ~46-~46: Make sure that the noun ‘setup’ is correct. Did you mean the past participle “set up”? (BE_VB_OR_NN)
Context: ...ocker #### Pre-commit Hooks Github is setup to run pre-commit hooks specified in .p...


#### macOS install


Expand Down
13 changes: 13 additions & 0 deletions server/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Auto-generated file
data/supabaseTypes.ts
eriktaubeneck marked this conversation as resolved.
Show resolved Hide resolved
postcss.config.js
supabase/.temp*
tailwind.config.ts
.next/*

# Config files
next.config.js
tsconfig.json

# Not JS
README.md
1 change: 1 addition & 0 deletions server/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 3 additions & 1 deletion server/app/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default function QueryStartedAlert({ queryId }: { queryId: string }) {
<div className="ml-3">
<p className="text-sm font-medium text-green-800">
Successfully started Query: {queryId}. Redirecting to
<Link href={`/query/view/${queryId}`}>/query/view/{queryId} </Link>.{" "}
<Link href={`/query/view/${queryId}`}>
/query/view/{queryId}{" "}
</Link>.{" "}
</p>
</div>
<div className="ml-auto pl-3">
Expand Down
20 changes: 11 additions & 9 deletions server/app/query/haikunator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ const haikunator = new Haikunator({
nouns: nouns,
});

function getCurrentTimestamp() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
return `${year}-${month}-${day}T${hours}${minutes}`;
function getCurrentTimestamp() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, "0");
const day = now.getDate().toString().padStart(2, "0");
const hours = now.getHours().toString().padStart(2, "0");
const minutes = now.getMinutes().toString().padStart(2, "0");
return `${year}-${month}-${day}T${hours}${minutes}`;
}

export default function NewQueryId(): string {
return encodeURIComponent(haikunator.haikunate({tokenLength: 0}) + getCurrentTimestamp());
return encodeURIComponent(
haikunator.haikunate({ tokenLength: 0 }) + getCurrentTimestamp(),
);
}
16 changes: 16 additions & 0 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"eslint": "^8",
"eslint-config-next": "14.0.3",
"postcss": "^8",
"prettier": "3.3.1",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
Expand Down
Loading