Skip to content

Commit

Permalink
chore: formatting changes (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpj2292 committed Feb 26, 2024
1 parent 8351b5c commit 108cbba
Show file tree
Hide file tree
Showing 79 changed files with 2,561 additions and 2,145 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"airbnb-base",
"airbnb-typescript/base",
"plugin:sonarjs/recommended",
"prettier",
"plugin:json/recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": ["@typescript-eslint", "unicorn"],
"globals": {},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
if: ${{ inputs.build_type == 'dt' }}
run: |
docker buildx imagetools create -t rudderstack/rudder-transformer:latest ${{ inputs.push_tags }}-amd64 ${{ inputs.push_tags }}-arm64
- name: Create latest ut multi-arch manifest
# To be triggered only for release/hotfix PR merges coming from `prepare-for-prod-ut-deploy.yaml`
if: ${{ inputs.build_type == 'ut' }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Commitlint

on: [push]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4.0.1
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
# Run the commitlint action, considering its own dependencies and yours as well 🚀
# `github.workspace` is the path to your repository.
- uses: wagoid/commitlint-github-action@v5
env:
NODE_PATH: ${{ github.workspace }}/node_modules
with:
commitDepth: 1
4 changes: 1 addition & 3 deletions .github/workflows/component-test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Uplaod Report to S3
run: |
aws s3 cp ./test_reports/ s3://test-integrations-dev/integrations-test-reports/rudder-transformer/${{ github.event.number }}/ --recursive
- name: Add Test Report Link as Comment on PR
uses: actions/github-script@v7
with:
Expand Down Expand Up @@ -75,5 +75,3 @@ jobs:
issue_number: prNumber,
body: commentBody
});
1 change: 0 additions & 1 deletion .github/workflows/prepare-for-staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
secrets:
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}


create-pull-request:
name: Update Helm Charts For Staging and Create Pull Request
runs-on: ubuntu-latest
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Verify

on:
pull_request:

jobs:
formatting-lint:
name: Check for formatting & lint errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: .nvmrc
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Run Lint Checks
run: |
npm run lint
- run: git diff --exit-code

- name: Error message
if: ${{ failure() }}
run: |
echo 'Eslint check is failing Ensure you have run `npm run lint` and committed the files locally.'
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test/**/*.js
!test/**/data.js
src/util/lodash-es-core.js
src/util/url-search-params.min.js
dist
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"prettier.requireConfig": true,
"prettier.configPath": ".prettierrc",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
},
"eslint.validate": ["javascript", "typescript"]
}
91 changes: 84 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"setup": "npm ci",
"setup:swagger": "swagger-cli bundle swagger/api.yaml --outfile dist/swagger.json --type json",
"format": "prettier --write .",
"lint": "eslint . || exit 0",
"lint:fix": "eslint . --fix",
"lint:fix:json": "eslint --ext .json --fix .",
"lint": "npm run format && npm run lint:fix",
"check:merge": "npm run verify || exit 1; codecov",
"start": "cd dist;node ./src/index.js;cd ..",
"build:start": "npm run build && npm run start",
Expand Down Expand Up @@ -136,9 +136,10 @@
"eslint": "^8.40.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-sonarjs": "^0.19.0",
"eslint-plugin-unicorn": "^46.0.1",
"glob": "^10.3.3",
Expand All @@ -151,7 +152,7 @@
"madge": "^6.1.0",
"mocked-env": "^1.3.5",
"node-notifier": "^10.0.1",
"prettier": "^2.8.8",
"prettier": "^3.2.4",
"semver": "^7.5.3",
"standard-version": "^9.5.0",
"supertest": "^6.3.3",
Expand Down
4 changes: 2 additions & 2 deletions src/adapters/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const fireHTTPStats = (clientResponse, startTime, statTags) => {
destType,
endpointPath,
requestMethod,
module
module,
});
stats.counter('outgoing_request_count', 1, {
feature,
Expand All @@ -66,7 +66,7 @@ const fireHTTPStats = (clientResponse, startTime, statTags) => {
success: clientResponse.success,
statusCode,
requestMethod,
module
module,
});
};

Expand Down
5 changes: 3 additions & 2 deletions src/adapters/networkHandlerFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ SUPPORTED_VERSIONS.forEach((version) => {
// },
// generic: GenericNetworkHandler,
// }
handlers[version][dest] =
require(`../${version}/destinations/${dest}/networkHandler`).networkHandler;
handlers[version][dest] = require(
`../${version}/destinations/${dest}/networkHandler`,
).networkHandler;
} catch {
// Do nothing as exception indicates
// network handler is not defined for that destination
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/v2/destinations/bingads_audience/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ steps:
const response = $.defaultRequestConfig();
response.body.JSON = payload;
response
)
)
2 changes: 1 addition & 1 deletion src/cdk/v2/destinations/bluecore/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ steps:
$.verifyPayload(newPayload, ^.message);
$.removeUndefinedNullValuesAndEmptyObjectArray(newPayload)
)[];
- name: buildResponse
template: |
$.context.payloads.(
Expand Down

0 comments on commit 108cbba

Please sign in to comment.