Open vikramsubramanian opened 3 months ago
To implement the feature of using Ruff for linting and formatting, follow these steps:
Install Ruff in the project environment:
pip install ruff
Create a configuration file for Ruff, if necessary, to define the linting and formatting rules. This might be a .ruff.toml
file at the root of the project.
Remove or disable the existing ESLint and Prettier configuration from the project to avoid conflicts. This involves:
.eslintrc.yml
.npm uninstall eslint prettier eslint-plugin-prettier eslint-plugin-mozilla
Update the project's build or CI configuration to run Ruff instead of ESLint. This could involve modifying scripts in package.json
or updating CI pipeline configurations such as .github/workflows
or infra/landings-pipeline.yml
.
Add a new script in package.json
to run Ruff for linting and optionally fixing issues:
"scripts": {
"lint": "ruff src/",
"lint:fix": "ruff src/ --fix"
}
Run Ruff to lint the project and fix issues:
npm run lint
npm run lint:fix
Update the documentation to instruct developers on how to use Ruff for linting and formatting.
If the project has a pre-commit hook or similar automation, update it to use Ruff instead of ESLint and Prettier.
Test the integration thoroughly to ensure that Ruff is correctly linting and formatting the code according to the project's standards.
Commit the changes and create a pull request for the new linting setup.
Please note that the provided code snippets from the codebase do not directly relate to the linting and formatting setup, so they are not modified as part of this feature implementation.
Proposal to use[ Ruff ]( for linting and code quality. Due to following reasons:
)