Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/code-quality-improvements #135

Merged
merged 16 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
- name: Create .env file
run: cp .env.dev .env

- name: Start services
run: docker compose -f docker-compose.dev.yaml up -d --build
run: docker compose -f docker-compose.dev.yaml up -d --build

- name: Run tests
run: |
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Pylint

on:
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
Expand All @@ -13,15 +13,15 @@ jobs:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --disable=all --enable=C0114,C0115,C0116,C0301
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --disable=all --enable=C0114,C0115,C0116,C0301
2 changes: 1 addition & 1 deletion frontend/.env.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_STARKNET_NODE_URL=http://178.32.172.148:6060
REACT_APP_BACKEND_URL=http://localhost:8000
REACT_APP_BACKEND_URL=http://localhost:8000
16 changes: 16 additions & 0 deletions frontend/.eslintrc.json
whateverfw marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"es6": true,
"browser": true
},
"globals": {
"BigInt": "readonly"
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true
}
}
}
10 changes: 10 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSpacing": true,
"trailingComma": "es5",
"tabWidth": 2,
"printWidth": 120,
"endOfLine": "lf"
}
8 changes: 5 additions & 3 deletions frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-react'],
};

presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-react",
],
};
6 changes: 3 additions & 3 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = {
setupFiles: ['./jest.setup.js'],
setupFiles: ['./jest.setup.js'],
transform: {
'^.+\\.[tj]sx?$': 'babel-jest', // Using Babel for transforming JS, JSX, TS, and TSX
},
moduleNameMapper: {
'\\.svg$': '<rootDir>/test/__mocks__/svgMock.js',
'\\.svg$': '<rootDir>/test/__mocks__/svgMock.js',
},
transformIgnorePatterns: [
'node_modules/(?!(axios|get-starknet)/)' // Ignore transforming node_modules
'node_modules/(?!(axios|get-starknet)/)', // Ignore transforming node_modules
],

testEnvironment: 'jsdom', // Use node as the test environment
Expand Down
2 changes: 1 addition & 1 deletion frontend/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TextEncoder, TextDecoder } from 'util';

global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
global.TextDecoder = TextDecoder;
6 changes: 6 additions & 0 deletions frontend/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src/**/*"]
}
Loading
Loading