Skip to content

Commit eaa60fd

Browse files
authored
Merge pull request #553 from di-sukharev/refactoring_v4
chore: tighten cli validation and tooling checks
2 parents 58b9d84 + 5fde6db commit eaa60fd

22 files changed

+2265
-2524
lines changed

.eslintrc.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 🐞 Bug Report
22
description: File a bug report
3-
title: "[Bug]: "
4-
labels: ["bug", "triage"]
3+
title: '[Bug]: '
4+
labels: ['bug', 'triage']
55
assignees:
66
- octocat
77
body:
@@ -48,7 +48,7 @@ body:
4848
label: What happened?
4949
description: Also tell us, what did you expect to happen?
5050
placeholder: Tell us what you see!
51-
value: "A bug happened!"
51+
value: 'A bug happened!'
5252
validations:
5353
required: true
5454
- type: textarea
@@ -58,7 +58,7 @@ body:
5858
description: Also tell us, what did you expect to happen?
5959
placeholder: Tell us what you expected to happen!
6060
validations:
61-
required: true
61+
required: true
6262
- type: textarea
6363
id: current-behavior
6464
attributes:
@@ -88,4 +88,4 @@ body:
8888
attributes:
8989
label: Relevant log output
9090
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
91-
render: shell
91+
render: shell

.github/ISSUE_TEMPLATE/featureRequest.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
name: 🛠️ Feature Request
33
description: Suggest an idea to help us improve Opencommit
4-
title: "[Feature]: "
4+
title: '[Feature]: '
55
labels:
6-
- "feature_request"
6+
- 'feature_request'
77

88
body:
99
- type: markdown
@@ -45,4 +45,4 @@ body:
4545
description: |
4646
Add any other context about the problem here.
4747
validations:
48-
required: false
48+
required: false

.github/workflows/codeql.yml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: 'CodeQL'
1313

1414
on:
1515
push:
16-
branches: [ "master" ]
16+
branches: ['master']
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "master" ]
19+
branches: ['master']
2020
schedule:
2121
- cron: '21 16 * * 0'
2222

@@ -32,45 +32,44 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript' ]
35+
language: ['javascript']
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Use only 'java' to analyze code written in Java, Kotlin or both
3838
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
3939
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
4040

4141
steps:
42-
- name: Checkout repository
43-
uses: actions/checkout@v4
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
4444

45-
# Initializes the CodeQL tools for scanning.
46-
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v3
48-
with:
49-
languages: ${{ matrix.language }}
50-
# If you wish to specify custom queries, you can do so here or in a config file.
51-
# By default, queries listed here will override any specified in a config file.
52-
# Prefix the list here with "+" to use these queries and those in the config file.
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v3
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
5353

54-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55-
# queries: security-extended,security-and-quality
54+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55+
# queries: security-extended,security-and-quality
5656

57+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
58+
# If this step fails, then you should remove it and run the build manually (see below)
59+
- name: Autobuild
60+
uses: github/codeql-action/autobuild@v3
5761

58-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59-
# If this step fails, then you should remove it and run the build manually (see below)
60-
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v3
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6264

63-
# ℹ️ Command-line programs to run using the OS shell.
64-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65+
# If the Autobuild fails above, remove it and uncomment the following three lines.
66+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6567

66-
# If the Autobuild fails above, remove it and uncomment the following three lines.
67-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68+
# - run: |
69+
# echo "Run, Build Application using script"
70+
# ./location_of_script_within_repo/buildscript.sh
6871

69-
# - run: |
70-
# echo "Run, Build Application using script"
71-
# ./location_of_script_within_repo/buildscript.sh
72-
73-
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@v3
75-
with:
76-
category: "/language:${{matrix.language}}"
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v3
74+
with:
75+
category: '/language:${{matrix.language}}'

.github/workflows/test.yml

Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,38 @@ jobs:
1111
linux-tests:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- name: Use Node.js
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: '20.x'
19-
cache: 'npm'
20-
- name: Setup git
21-
run: |
22-
git config --global user.email "test@example.com"
23-
git config --global user.name "Test User"
24-
- name: Install dependencies
25-
run: npm ci
26-
- name: Run Unit Tests
27-
run: npm run test:unit
28-
- name: Run Core E2E Tests
29-
run: npm run test:e2e:core
30-
- name: Run Prompt Module E2E Tests
31-
run: npm run test:e2e:prompt-module
14+
- uses: actions/checkout@v4
15+
- name: Use Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20.x'
19+
cache: 'npm'
20+
- name: Setup git
21+
run: |
22+
git config --global user.email "test@example.com"
23+
git config --global user.name "Test User"
24+
- name: Install dependencies
25+
run: npm ci
26+
- name: Run Lint
27+
run: npm run lint
28+
- name: Run Format Check
29+
run: npm run format:check
30+
- name: Run Unit Tests
31+
run: npm run test:unit
32+
- name: Run Core E2E Tests
33+
run: npm run test:e2e:core
34+
- name: Run Prompt Module E2E Tests
35+
run: npm run test:e2e:prompt-module
3236
macos-smoke:
3337
runs-on: macos-latest
3438
steps:
35-
- uses: actions/checkout@v4
36-
- name: Use Node.js
37-
uses: actions/setup-node@v4
38-
with:
39-
node-version: '20.x'
40-
cache: 'npm'
41-
- name: Install dependencies
42-
run: npm ci
43-
- name: Run Smoke E2E Tests
44-
run: npm run test:e2e:smoke
45-
prettier:
46-
runs-on: ubuntu-latest
47-
steps:
48-
- uses: actions/checkout@v4
49-
- name: Use Node.js
50-
uses: actions/setup-node@v4
51-
with:
52-
node-version: '20.x'
53-
cache: 'npm'
54-
- name: Install dependencies
55-
run: npm ci
56-
- name: Run Prettier
57-
run: npm run format:check
58-
- name: Prettier Output
59-
if: failure()
60-
run: |
61-
echo "Prettier check failed. Please run 'npm run format' to fix formatting issues."
62-
exit 1
39+
- uses: actions/checkout@v4
40+
- name: Use Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: '20.x'
44+
cache: 'npm'
45+
- name: Install dependencies
46+
run: npm ci
47+
- name: Run Smoke E2E Tests
48+
run: npm run test:e2e:smoke

biome.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.11/schema.json",
33

44
"vcs": {
55
"enabled": true,
@@ -13,7 +13,7 @@
1313
},
1414

1515
"formatter": {
16-
"enabled": true,
16+
"enabled": false,
1717
"indentStyle": "space",
1818
"indentWidth": 2,
1919
"lineEnding": "lf"
@@ -33,7 +33,12 @@
3333
"rules": {
3434
"recommended": true,
3535
"suspicious": {
36-
"noConsole": "error"
36+
"noConsole": "off",
37+
"noImplicitAnyLet": "off",
38+
"useIterableCallbackReturn": "off"
39+
},
40+
"correctness": {
41+
"noSwitchDeclarations": "off"
3742
},
3843
"style": {
3944
"noNonNullAssertion": "off"
@@ -42,10 +47,10 @@
4247
},
4348

4449
"assist": {
45-
"enabled": true,
50+
"enabled": false,
4651
"actions": {
4752
"source": {
48-
"organizeImports": "on"
53+
"organizeImports": "off"
4954
}
5055
}
5156
}

jest.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const config: Config = {
1515
testRegex: ['.*\\.test\\.ts$'],
1616
// Tell Jest to ignore the specific duplicate package.json files
1717
// that are causing Haste module naming collisions
18-
modulePathIgnorePatterns: [
19-
'<rootDir>/test/e2e/prompt-module/data/'
20-
],
18+
modulePathIgnorePatterns: ['<rootDir>/test/e2e/prompt-module/data/'],
2119
transformIgnorePatterns: [
2220
'node_modules/(?!(cli-testing-library|@clack|cleye|chalk)/.*)'
2321
],

0 commit comments

Comments
 (0)