-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add pylint to sniff for PEP8 compliance #507
Comments
name: Pylint check
on:
pull_request:
branches:
- "master"
- "dev"
jobs:
pylint-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Create virtual environment
run: python -m venv venv
working-directory: ${{ github.workspace }}
- name: Activate virtual environment and install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
deactivate
working-directory: ${{ github.workspace }}
- name: Analyze code with Pylint
run: |
source venv/bin/activate
pylint $(git ls-files '*.py')
deactivate
working-directory: ${{ github.workspace }} I've attached the list of warnings that pylint is currently throwing. We should resolve these before setting this Github Action or else our pull requests will fail |
@WilliamZekaiWang can you please split a new branch off |
python3 -m venv venv # install virtual environment
source venv/bin/activate # start environment
pip install pylint # run this first time to install PyLint
pylint $(git ls-files '*.py')
deactivate # exit environment |
@WilliamZekaiWang you do not need to address warnings for the deprecated files in |
|
I've used There are a few things that I realized
Sounds like a lot, but it does genuinely lighten the workload I also used |
Thanks @WilliamZekaiWang for the update! |
finishing up now, I have finished all the files in the main directory and the covizu directory. They all seemed to pass the unittests as well generally, there's one small thing that I'm iffy on changing:
For this function in
also, pylint requires a docstring at the top of the file to explain what it does. I'm not quite sure what to add for most of the files file specifically, there were 2 things I couldn't quite figure out. The first I can't find that error existing. The second error, I assumed value error?
|
|
I have finished pep8-ing all files including utils and unittests I think it's ok if we don't have docstrings for unittests. There are also a few TODO/FIXMEs in the files which raises a concern on pylint specific functions/classes I don't really understand that need docstring:
Another except that I'm not sure the specific catch would be: covizu/covizu/utils/batch_utils.py Lines 251 to 290 in ec04d1c
Functions that have greater than 6 arguments:
Functions that have too many local variables (>15) that I couldn't really figure out a way to break down:
I should also add I tried my best to solve the >15 local variables by adding more function. I think most of them help with readability except 2 classes had too few public methods:
|
|
I forgot that we are in the middle of refactoring |
|
You might find examples of unit tests for tree objects in Line 8 in ca3379d
|
Wait for PR #529 to be resolved before making a new PR from this branch into |
@WilliamZekaiWang to create PR |
Next step will be to issue a PR from |
Add as a GitHub action
The text was updated successfully, but these errors were encountered: