From c609ec0edd0268343f33189c445f1c9e4d9e7fd2 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 8 Jul 2024 15:44:22 -0500 Subject: [PATCH] Run linter on all relevant file changes. (#383) * Fix: lint errors in bulk.yml. Signed-off-by: dblock * Run linter on all PRs. Signed-off-by: dblock --------- Signed-off-by: dblock --- .github/workflows/lint.yml | 31 +++++++++++++++++++++++++++ .github/workflows/test-tools-unit.yml | 3 --- tests/_core/bulk.yaml | 26 +++++++++++----------- 3 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..09b9f5168 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: Lint + +on: + push: + branches: ['**'] + paths: + - '**/*.yaml' + - '**/*.ts' + pull_request: + branches: ['**'] + paths: + - '**/*.yaml' + - '**/*.ts' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install Dependencies + run: npm install + + - name: Lint + run: npm run lint diff --git a/.github/workflows/test-tools-unit.yml b/.github/workflows/test-tools-unit.yml index baf009678..99f5f7008 100644 --- a/.github/workflows/test-tools-unit.yml +++ b/.github/workflows/test-tools-unit.yml @@ -35,9 +35,6 @@ jobs: - name: Install Dependencies run: npm install - - name: Lint - run: npm run lint - - name: Tests run: | npm run test:unit -- --coverage diff --git a/tests/_core/bulk.yaml b/tests/_core/bulk.yaml index e7cc18cb0..f5cb71dae 100644 --- a/tests/_core/bulk.yaml +++ b/tests/_core/bulk.yaml @@ -12,23 +12,23 @@ chapters: request_body: content_type: application/x-ndjson payload: - - { create: { _index: movies } } - - { director: Bennett Miller, title: Moneyball, year: 2011 } + - {create: {_index: movies}} + - {director: Bennett Miller, title: Moneyball, year: 2011} - synopsis: Bulk document CRUD. path: /_bulk method: POST request_body: content_type: application/x-ndjson payload: - - { create: { _index: books, _id: book_1392214 } } - - { author: Harper Lee, title: To Kill a Mockingbird, year: 1960 } - - { update: { _index: books, _id: book_1392214 } } - - { doc: { pages: 376 } } - - { update: { _index: books, _id: book_1392214 } } - - { doc: { pages: 376 }, _source: true } - - { update: { _index: books, _id: book_1392214 } } - - { script: { source: 'ctx._source.pages = 376;' } } - - { update: { _index: books, _id: does_not_exist } } - - { script: { source: 'ctx.op = "none";' }, scripted_upsert: true, upsert: { pages: 375 } } - - { delete: { _index: books, _id: book_1392214 } } + - {create: {_index: books, _id: book_1392214}} + - {author: Harper Lee, title: To Kill a Mockingbird, year: 1960} + - {update: {_index: books, _id: book_1392214}} + - {doc: {pages: 376}} + - {update: {_index: books, _id: book_1392214}} + - {doc: {pages: 376}, _source: true} + - {update: {_index: books, _id: book_1392214}} + - {script: {source: 'ctx._source.pages = 376;'}} + - {update: {_index: books, _id: does_not_exist}} + - {script: {source: 'ctx.op = "none";'}, scripted_upsert: true, upsert: {pages: 375}} + - {delete: {_index: books, _id: book_1392214}}