-
Notifications
You must be signed in to change notification settings - Fork 208
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
Enable PyLint rules of your own choice and fix the errors #1755
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
…4 (superfluous-parens), C0410 (multiple-imports), E0213 (no-self-argument) (#1766) Thank you to Ayush Saluja (@ayush571995) for this contribution. Related to #1755
Hello, my name is Vincent and I am new to Github open source contributions. For this issue, do I just select any error in test_lint.py and parse through any files within the entire program for that error and fix it? |
Hello Vincent, As a first step I would say you fork the repo, create a separate branch and then try to run the test suite on your own system. When this works we can step further. Best |
Hello Christian, |
That means something is wrong. How do you run the test? Can you post the command?
Or
The output then should indicate that one test was run and passed.
Yes. Then run the tests again and then see where the errors appear. Important: Keep the PullRequest small. No matter in how many files the error appears, fix only one file per PullRequest. You can exception that rule if you have 3 errors in 3 files for example. Decide this on your own. But keep the PR simple and small. |
Hello, and the output was: I see several import errors. I have read the Build & install and the dependencies section of the documentation. I believe I have installed ubuntu and the dependencies on my windows command prompt but I am unsure if this is the cause of the import errors. I also tried to uncomment specific lines such as "no-member / E1101" and "'R0201', # no-self-use" but there are no additional errors to the pylint test other than those original 54 errors. |
qt_probing.py:120:4: E0401: Unable to import 'PyQt6.QtWidgets' (import-error) ============================================================= short test summary info ============================================================= |
This sentence confuses me. You installed ubuntu but using a windows command prompt? Are you using "Windows Subsystem for Linux" (WSL) instead of a real GNU Linux? The import errors you reporting are very exotic and uncommon. Using a WSL might explain them. WSL is not supported. You can use Back In Time only on a real/full GNU Linux distribution but not on Windows. If you still use a real GNU Linux then we need to investigate the problem further. Despite the unit tests are you able to start BIT?
No need to apologize. We are doing this to increase our experience and learn. 😄 |
Oh I see, yeah I am currently on Windows working on VS code and for the terminal using cmd. I tried WSL because I figured that would work as a good substitute to GNU Linux but I guess not. Yeah not able to run BIT because it says "ModuleNotFoundError: No module named 'syslog'" I guess that means I can't work on this project on Windows? |
You can not provide new or modified code to the project, right. |
It's okay, thank you for all your help. |
Hello Christian, I am 37. Started coding a few days ago after a gap of about 15 years. The last time I coded was in High School in C and it was a horrible experience. Always wanted to code but due to time constraints I was unable to do so. Now, I have decided to devote 2 hours daily. Presently learning python and it is so simple and powerful. I hope to contribute something to any Open Source project as I learn a bit more of Python. Presently, I will read the CONTIRBUTION.md and try to follow the instructions. Kind Regards, |
Hello N0madC0de, Christian |
Started learning Python about 15 days ago. I tried the test_lint.py. This is the output I got: root@parb-B760M-DS3H-AX-DDR4:/home/parb/Documents/github-clones/backintime/common/test# pytest -v test_lint.py test_lint.py::MirrorMirrorOnTheWall::test_with_pylint FAILED [100%] ============================================================================ FAILURES ============================================================================ self = <test.test_lint.MirrorMirrorOnTheWall testMethod=test_with_pylint>
E AssertionError: 0 != 8 : PyLint found 8 problems. test_lint.py:133: AssertionError ==================================================================== short test summary info ===================================================================== What to do next sir? |
Hello N0madC0de,
I really appreciate your effort to contribute but I would say this is to early for us. We do accept that we need to invest some time and resource into guiding new contributors in the project. But this project is not a Python learning course. We can not effort that. We have no company and no money behind. We do this in our spare time beside our regular life. I am sorry. About your output you provided. You shouldn't work with your Maybe have a look at r/learnpython. Best, |
Thanks for the suggestions. |
Remove unused method debugTrace(). Enable PyLint rule W1515 (forgotten-debug-statement). Replace deprecated PyLint rule C0324 with C0325 (superfluous-parens). Removed ImportError check for class MutableSet because not relevant anymore since Python 3.3. Related to #1755
Hello Christian, |
Hello Manuel, Keep the Pull Request small. That make reviews easier. It means don't modify to much files at once. If you choose a linter rule that cause warnings in 20 files, just fix 1 or 2 of that files and then disable that rule again before creating the Pull Request. Don't hesitate to ask. |
Hello Christian, This rule affects many files but the changes in every file are quite small. Can I also add more files in such cases, or should I continue changing only a few files per PR? |
Hello Manual, |
Hey Christian! I've been going to school studying computer science for a few years and am currently focused on cybersecurity. I have experience with Python and a few other languages. I'm a big user of Linux and Android open-source but have yet to contribute. I was able to fork and then create a new branch with the repo. I then tried uncommenting error code It returned what seems to be the default output.
I then tried using Also, I fix some minor grammatical errors within the Thanks, |
Hello Keith, Yes this looks as expected. Not all of the rules to cause errors. We might have fixed some of them in the near past. btw: If you have a native language different from English you could also give our translation platform a try. Best, |
I submitted my PR #1788 for a few grammatical errors I fixed on the test_lint.py file. I feel like I'm missing something when trying to run the unit test as described in the instructions and in my previous comment. I tried uncommenting all of the error codes in |
hey. I pushed PR to enable code-duplication pylint checks #1803 |
Hey Christian, I am Saksham and I have 3 years of experience as a SDE. I looked up and found out this project has pretty good issues for good first time contributors. As, I have just started my journey in open source contribution, I would really appreciate some directions regarding this issue. I have a good handle on py3 and I have done early development env setup for this project. Please guide me through the next steps. |
Hello Saksham, Just have look at the warnings and errors of PyLint as described in the initial posting. Have a look in the PullRequest section. There are some other contributors working on some of the linter rules. Do you know how to fork/branch and create pull requests? Which one of the linter rules you would like to work on? Don't hesitate to ask back. Best, |
Hello Christian, Thank you for your message and the opportunity to contribute.
Please let me know if there are any specific guidelines or considerations for addressing this linter rule. I look forward to contributing to the project. Best regards, |
Hello Saksham, Currently all PRs are blocked because we are in the middle of a release process. We won't merge PRs until our upstream release reaches the Debian repository. That is why we have so many open PRs currently. About your questions.
This is up to you to decide. It does not depend only on the number of files modified but also an the amount of lines (and contexts) modified. If it is just about removing some lines with unused variables in 13 files I would be fine with one single PR. If you are unsure it is better to split up into several PRs. Smaller is better. It is easier (for me) to deal with 13 tiny PRs instead of one big PR.
Not mandatory but it should be this way if possible but also don't have to be. Best, |
Hello Christian, Thank you for the clarification. I will work on fixing the W0612 errors in the qt folder as suggested. Should I wait until the release process is completed before submitting any PRs? Thank you for the guidance. Best regards, |
You can submit the PR when ever you want. |
Please check #1831. |
Activate PyLint rule W0611 (unused imports) and fix the errors. Thank you to Manual (@feman323) for this contribution. Related to #1755 --------- Co-authored-by: buhtz <[email protected]>
Thank you to Manual (@feman323) for this contribution. Related to #1755 . --------- Co-authored-by: buhtz <[email protected]>
Thank you to Keith Bates (@dnerever) for this contribution. Related to #1755 --------- Co-authored-by: buhtz <[email protected]>
Thank you to Ihor Pryyma (@Ihor-Pryyma) for this contribution. Related to #1755 --------- Co-authored-by: buhtz <[email protected]>
Hi, my name is Pratik. I’m starting to contribute on GitHub to learn more about the platform and improve my Python skills. Right now, I’m focused on solving issues to test my knowledge and explore different types of problems. I found this project through GitHub's explore feature while looking for "good first issues." My goal is to learn, connect with new people, and dive deeper into Python. Looking forward to contributing and growing! |
Hi Pratik, |
Thanks @buhtz I will look into it and comment here what issue I will work on. |
… variables to improve code readability and maintain a cleaner codebase. This change resolves the linting issues related to unused variables mentioned in issue bit-team#1755.
Related to #1755 Thank you to Iván Rodríguez (@ivanrdgz03) for this contribution. --------- Co-authored-by: Christian Buhtz <[email protected]>
Introduction
Welcome to the project, if you pick up this Issue because of the "GOOD FIRST USE" label. You will be mentored through the process if you want. First the Issue is explained. At the end you will find some guidance for first contributors. Please do not hesitate to ask questions. Your solution don't need to be perfect.
Be aware that this is a meta Issue not describing one specific problem and task, but a bunch of similar problems you can choose from.
It is a fine issue for beginners. But participation or contribution is not recommended unless you are familiar with Back In Time and are an active user. This project is not intended for learning basic Python skills or enhancing your GitHub profile.
Problem
Code analyzing tools like PyLint and others show multiple of 1.000 errors (~4.500 in default configuration) on the current code base of Back In Time. They can not be fixed all at once. Back In Time currently use
pylint
in two unit test (seecommon/test/test_lint.py
andqt/test/test_lint.py
) with a very small selection of enabled error codes.In the code of the two files
common/test/test_lint.py
andqt/test/test_lint.py
you will find a list of disabled error codes you can start with:Be aware that there are two files named
test_lint.py
, one in foldercommon/test
and one inqt/test
. They should be identical, especially the list of enabled/disabled error codes.Solution
Pick one of the disabled error codes listed in the source code linked above. Have a look at the PyLint documentation to read about that error code and how to fix it. You don't need to stick to the existing list of error codes. You are free to choose another one if you are able to fix it. Important: Pick one error only and work on one file only. Don't blow up the Pull Request.
Your next steps
test_lint.py
files.common
and/orqt
and runpytest test/test_lint.py
. Work on that errors but only on one of the source files per PullRequest.The text was updated successfully, but these errors were encountered: