Skip to content

Full Toolkit for Next-Level Domain Analysis

Validate code format in CI 👀

Felix Wotschofskyb47539ae8101
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..21bbbf7
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,27 @@
+name: Testing
+
+on:
+ push:
+ branches:
+ - '**'
+
+jobs:
+ formatting:
+ name: Code Formatting
+ runs-on: ubuntu-22.04
+ timeout-minutes: 10
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v3
+
+ - name: Setup Node.js 18
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: yarn
+
+ - name: Install Dependencies
+ run: yarn install --immutable
+
+ - name: Run Tests
+ run: yarn run test:format
diff --git a/components/SearchForm.tsx b/components/SearchForm.tsx
index 72bf9c7..cf83b37 100644
--- a/components/SearchForm.tsx
+++ b/components/SearchForm.tsx
@@ -41,7 +41,7 @@ const SearchForm = (props: SearchFormProps) => {
let tDomain;
try {
tDomain = new URL(domain.trim().toLowerCase()).hostname;
- } catch(err) {
+ } catch (err) {
tDomain = domain.trim().toLowerCase();
}
diff --git a/package.json b/package.json
index 4e9fac7..f37cf5b 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
+ "test:format": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss,md,mdx}\"",
"format": "yarn prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss,md,mdx}\""
},
"dependencies": {