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

DBC22-783: backend linting setup #317

Merged
merged 3 commits into from
Mar 5, 2024
Merged

DBC22-783: backend linting setup #317

merged 3 commits into from
Mar 5, 2024

Conversation

ray-oxd
Copy link
Collaborator

@ray-oxd ray-oxd commented Mar 5, 2024

Recreated this PR from #109.

This PR added backend linting capability by applying pylint on python code.
Please configure the dev IDE to enable pylint on VS Code or PyCharm.

How to Install Pylint in PyCharm:

pip install pylint
use "which pylint" (for mac) or "where pylint" (for windows) to get the Pylint installation path.
navigate to File->Settings->External tools.
Enter the installation path of pylint in the field 'Program', enter data for all other fields as desired, i.e., Arguments: the .pylintrc file path in the backend python code, Working directory: to the backend python code root directory.
right clicke on the python file, select Open in-> Terminal
Run command 'pylint fileName.py'
The .pylintrc file is generated by using command "pylint --generate-rcfile>.pylintrc", to make the linting rules customizable.

How to linting python in VS Code:

install pylint from extensions in VS Code.
pylint can be enabled/disabled by right click on the settings of pylint.
VS code has the ability to auto detect customizable .pylintrc file in the backend python root directory.
When open or save a changed python file, pylint will be reporting errors or warning in the code based on the default linting rules and customized linting rules.

@ray-oxd ray-oxd requested a review from fatbird March 5, 2024 19:23
@ray-oxd
Copy link
Collaborator Author

ray-oxd commented Mar 5, 2024

The pylint plugin can be used for intelliJ IDEs.

After installation, restart and set Path to pylintrc e.g. /Users/ray/PycharmProjects/DriveBC.ca/src/backend/.pylintrc and hit apply/OK. There will be a new pylint tool windows available to run scans on single file, module or entire project. As well, real-time scans should be on by default.

Feel free to modify or make suggestions on the config.

@fatbird fatbird merged commit 05dde50 into main Mar 5, 2024
3 checks passed
@ray-oxd ray-oxd deleted the feature/DBC22-783-2 branch March 6, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants