Skip to content

Commit

Permalink
chore: standard formatting (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpj2292 authored Feb 14, 2024
1 parent 5ade22c commit e4a0f0a
Show file tree
Hide file tree
Showing 23 changed files with 11,962 additions and 5,648 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
test
reports/
coverage
20 changes: 16 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@ module.exports = {
es2021: true,
commonjs: true,
},
extends: ["prettier", "eslint:recommended", "plugin:json/recommended"],
extends: ['eslint:recommended', 'plugin:json/recommended', 'prettier'],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'no-undef': 'warn',
'no-case-declarations': 'warn',
'no-unused-vars': [
'warn', // or "error"
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'no-useless-escape': 'warn',
},
rules: {},
};
53 changes: 53 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## What are the changes introduced in this PR?

Write a brief explainer on your code changes.

## What is the related Linear task?

Resolves INT-XXX

## Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, **mandatorily** mention them here

### Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

### Any new dependencies introduced with this change?

N/A

### Any new generic utility introduced or modified. Please explain the changes.

N/A

### Any technical or performance related pointers to consider with the change?

N/A

<hr>

### Developer checklist

- [ ] My code follows the style guidelines of this project

- [ ] **No breaking changes are being introduced.**

- [ ] All related docs linked with the PR?

- [ ] All changes manually tested?

- [ ] Any documentation changes needed with this change?

- [ ] Is the PR limited to 10 file changes?

- [ ] Is the PR limited to one linear task?

- [ ] Are relevant unit and component test-cases added?

### Reviewer checklist

- [ ] Is the type of change in the PR title appropriate as per the changes?

- [ ] Verified that there are no credentials or confidential data exposed with the changes.
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
60 changes: 60 additions & 0 deletions .github/workflows/tests-code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Tests with lint check and code coverage
on:
workflow_call:
secrets:
SONAR_TOKEN:
required: true

pull_request:
types: ['opened', 'reopened', 'synchronize']

jobs:
coverage:
name: Tests with lint check and code coverage
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 1

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

- name: Install Dependencies
run: npm ci

- name: Run Tests & lint check
run: |
npm run test
npm run check:lint
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v3.1.4
with:
directory: ./reports/coverage

- name: Update sonar-project.properties
run: |
# Retrieve the version from package.json
version=$(node -e "console.log(require('./package.json').version)")
# Update the sonar-project.properties file with the version
sed -i "s/sonar.projectVersion=.*$/sonar.projectVersion=$version/" sonar-project.properties
- name: Fix filesystem paths in generated reports
if: always()
run: |
sed -i 's+home/runner/work/rudderstack-shopify-tracker/rudderstack-shopify-tracker+/github/workspace+g' reports/coverage/lcov.info
sed -i 's+/home/runner/work/rudderstack-shopify-tracker/rudderstack-shopify-tracker+/github/workspace+g' reports/eslint.json
- name: SonarCloud Scan
if: always()
uses: SonarSource/sonarcloud-github-action@v2.1.1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ dist

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
.vscode

# yarn v2
.yarn/cache
Expand All @@ -144,6 +143,5 @@ dist
.svelte-kit

# Others
**/.vscode

reports/
# End of https://www.toptal.com/developers/gitignore/api/node
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
reports/
CHANGELOG.md
CONTRIBUTING.md
LICENSE
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"]
}
Loading

0 comments on commit e4a0f0a

Please sign in to comment.