mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
build: run format in ci (#11342)
* style: run format on existing files * build: run format in ci * build: add format:ci to check formatting in ci
This commit is contained in:
parent
b0ea913f4e
commit
de8eb04c72
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@ -20,10 +20,12 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "18.x"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- run: npm i
|
||||
- run: npm run lint
|
||||
|
||||
- run: npm run format:ci
|
||||
|
||||
# These tests run in standard node containers with their db attached as a service
|
||||
database-tests:
|
||||
@ -36,7 +38,6 @@ jobs:
|
||||
with:
|
||||
node-container: ${{matrix.node-container}}
|
||||
|
||||
|
||||
# These tests run with custom docker image attributes that can't be specified in a GHA service
|
||||
database-compose-tests:
|
||||
strategy:
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
"peerDependencies": {
|
||||
"@google-cloud/spanner": "^5.18.0",
|
||||
"@sap/hana-client": "^2.12.25",
|
||||
"better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0" ,
|
||||
"better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",
|
||||
"hdb-pool": "^0.1.6",
|
||||
"ioredis": "^5.0.4",
|
||||
"mongodb": "^5.8.0",
|
||||
@ -244,6 +244,7 @@
|
||||
"pack": "gulp pack",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --cache --write --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"",
|
||||
"format:ci": "prettier --check --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
|
||||
},
|
||||
"bin": {
|
||||
@ -257,4 +258,4 @@
|
||||
"url": "https://opencollective.com/typeorm",
|
||||
"logo": "https://opencollective.com/opencollective/logo.txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ export class CommandUtils {
|
||||
): Promise<DataSource> {
|
||||
let dataSourceFileExports
|
||||
try {
|
||||
[dataSourceFileExports] = await importOrRequireFile(
|
||||
;[dataSourceFileExports] = await importOrRequireFile(
|
||||
dataSourceFilePath,
|
||||
)
|
||||
} catch (err) {
|
||||
|
||||
@ -520,7 +520,7 @@ export class DataSource {
|
||||
|
||||
/**
|
||||
* Executes raw SQL query and returns raw database results.
|
||||
*
|
||||
*
|
||||
* @see [Official docs](https://typeorm.io/data-source-api) for examples.
|
||||
*/
|
||||
async query<T = any>(
|
||||
|
||||
@ -169,7 +169,7 @@ export class EntityManager {
|
||||
|
||||
/**
|
||||
* Executes raw SQL query and returns raw database results.
|
||||
*
|
||||
*
|
||||
* @see [Official docs](https://typeorm.io/entity-manager-api) for examples.
|
||||
*/
|
||||
async query<T = any>(query: string, parameters?: any[]): Promise<T> {
|
||||
|
||||
@ -1152,7 +1152,8 @@ export abstract class QueryBuilder<Entity extends ObjectLiteral> {
|
||||
|
||||
const cteStrings = this.expressionMap.commonTableExpressions.map(
|
||||
(cte) => {
|
||||
let cteBodyExpression = typeof cte.queryBuilder === 'string' ? cte.queryBuilder : '';
|
||||
let cteBodyExpression =
|
||||
typeof cte.queryBuilder === "string" ? cte.queryBuilder : ""
|
||||
if (typeof cte.queryBuilder !== "string") {
|
||||
if (cte.queryBuilder.hasCommonTableExpressions()) {
|
||||
throw new TypeORMError(
|
||||
|
||||
@ -644,7 +644,7 @@ export class Repository<Entity extends ObjectLiteral> {
|
||||
/**
|
||||
* Executes a raw SQL query and returns a raw database results.
|
||||
* Raw query execution is supported only by relational databases (MongoDB is not supported).
|
||||
*
|
||||
*
|
||||
* @see [Official docs](https://typeorm.io/repository-api) for examples.
|
||||
*/
|
||||
query(query: string, parameters?: any[]): Promise<any> {
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
import {
|
||||
Entity,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
PrimaryColumn
|
||||
} from "../../../../../src"
|
||||
import { Entity, ManyToOne, OneToMany, PrimaryColumn } from "../../../../../src"
|
||||
import { Company } from "./Company"
|
||||
import { TimeSheet } from "./TimeSheet"
|
||||
|
||||
|
||||
@ -25,11 +25,21 @@ describe("multi-database > basic-functionality", () => {
|
||||
it(`[${platform}] produces deterministic, unique, and valid table names for relative paths; leaves absolute paths unchanged`, () => {
|
||||
const testMap = [
|
||||
["FILENAME.db", "filename.db"],
|
||||
["..\\FILENAME.db", platform === 'win32' ? "../filename.db" : "..\\filename.db"],
|
||||
[".\\FILENAME.db", platform === 'win32' ? "./filename.db" : ".\\filename.db"],
|
||||
[
|
||||
"..\\FILENAME.db",
|
||||
platform === "win32"
|
||||
? "../filename.db"
|
||||
: "..\\filename.db",
|
||||
],
|
||||
[
|
||||
".\\FILENAME.db",
|
||||
platform === "win32"
|
||||
? "./filename.db"
|
||||
: ".\\filename.db",
|
||||
],
|
||||
[
|
||||
"..\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\FILENAME.db",
|
||||
platform === 'win32'
|
||||
platform === "win32"
|
||||
? "../longpathdir/longpathdir/longpathdir/longpathdir/longpathdir/longpathdir/longpathdir/filename.db"
|
||||
: "..\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\longpathdir\\filename.db",
|
||||
],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user