Skip to content

Commit fb7ea7b

Browse files
authored
Merge pull request #5 from JoelMiller74/update-codecov-results
Update CI configuration and enhance test coverage reporting
2 parents dc33bac + 8a3e111 commit fb7ea7b

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 2
1820

1921
- name: Setup Node.js
2022
uses: actions/setup-node@v4
@@ -55,8 +57,11 @@ jobs:
5557
run: npm run coverage --if-present
5658

5759
- name: Upload coverage to Codecov
58-
uses: codecov/codecov-action@v4
60+
uses: codecov/codecov-action@v5
61+
with:
62+
token: ${{ secrets.CODECOV_TOKEN }}
63+
- name: Upload test results to Codecov
64+
if: ${{ !cancelled() }}
65+
uses: codecov/test-results-action@v1
5966
with:
60-
files: ./coverage/lcov.info,./coverage/coverage-final.json
61-
fail_ci_if_error: true
62-
verbose: true
67+
token: ${{ secrets.CODECOV_TOKEN }}

src/formatter/engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export function formatTsql(text: string, { options, config, profile }: EngineCon
268268
// DDL: align CREATE TABLE column definitions (basic)
269269
const alignCols = config.get?.('alignColumnDefinitions', true);
270270
if (alignCols) {
271-
out = out.replace(/CREATE\s+TABLE\s+([\s\S]*?)\(([\s\S]*?)\)/gi, (m, tbl, cols) => {
271+
out = out.replace(/CREATE\s+TABLE\s+([\s\S]*?)\s*\(((?:[^()]*|\([^()]*\))*)\)/gi, (m, tbl, cols) => {
272272
const lines = cols.split(',').map((s: string) => s.trim());
273273
const maxName = Math.max(...lines.map((l: string) => (l.split(/\s+/)[0] || '').length));
274274
const padded = lines.map((l: string) => {

src/test/formatter.vitest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ describe('Formatter Engine (Vitest)', () => {
205205
it('align column definitions true', () => {
206206
const t = 'CREATE TABLE t (id INT, name VARCHAR(50))';
207207
const out = formatTsql(t, { options: {} as any, config: cfg({ alignColumnDefinitions: true }), profile: {} });
208-
expect(out).toBe('CREATE TABLE t (\n id INT,\n name VARCHAR(50)\n))');
208+
console.log('align-cols OUT:\n' + out);
209+
expect(out).toBe('CREATE TABLE t (\n id INT,\n name VARCHAR(50)\n)');
209210
});
210211

211212
it('bracket identifiers remove', () => {

vitest.config.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vitest.config.js.map

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)