From 4459d745c5fa54bd883d1b147b5c2b7fe647be74 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Wed, 10 Jul 2024 07:38:36 +0200 Subject: [PATCH] include linting and formatting in ci build --- .azure/ci.yml | 4 ++-- .gitattributes | 29 +++++++++++++++++++++++++++++ .github/workflows/ci.yml | 4 ++-- package.json | 8 ++++---- 4 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .gitattributes diff --git a/.azure/ci.yml b/.azure/ci.yml index 5a0ace882..139d10516 100644 --- a/.azure/ci.yml +++ b/.azure/ci.yml @@ -42,8 +42,8 @@ jobs: npm install displayName: 'Install dependencies' - pwsh: | - npm run lint - npm run format-check + npm run lint:check + npm run format:check displayName: 'Check code formatting' - pwsh: | npm run build:tools diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..9a5cb2225 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,29 @@ +# Auto detect text files and perform LF normalization +* text=auto eol=lf + +# Declare files that will always have LF line endings on checkout. +*.sh text eol=lf + +# Don't check these into the repo as LF to work around TeamCity bug +*.xml -text +*.targets -text + +# Custom for Visual Studio +*.cs diff=csharp +*.sln +*.csproj +*.vbproj +*.fsproj +*.dbproj + +# Denote all files that are truly binary and should not be modified. +*.dll binary +*.exe binary +*.png binary +*.ico binary +*.snk binary +*.pdb binary +*.svg binary + +# Don't check for trailing whitespace at end of lines in the doc pages +*.md -whitespace=blank-at-eol diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78d1c0a9a..0b768df0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,8 @@ jobs: npm install name: Install dependencies - run: | - npm run lint - npm run format-check + npm run lint:check + npm run format:check name: Check code formatting - run: | npm run build:tools diff --git a/package.json b/package.json index 34d92bd69..9b259ba18 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,10 @@ "scripts": { "build": "run-p build:tools build:agents", "test": "run-p test:tools test:agents", - "lint": "eslint --ext .ts src", - "lint-fix": "eslint --ext .ts src --fix", - "format": "prettier --write \"src/**/*.ts\"", - "format-check": "prettier --check \"src/**/*.ts\"", + "lint:check": "eslint --ext .ts src", + "lint:fix": "eslint --ext .ts src --fix", + "format:check": "prettier --check \"src/**/*.ts\"", + "format:fix": "prettier --write \"src/**/*.ts\"", "build:tools": "vite build --config src/tools/vite.config.mts", "build:agents": "run-p build:agent:local build:agent:azure build:agent:github",