Skip to content

Enable more linting #292

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

Closed
wants to merge 1 commit into from
Closed

Enable more linting #292

wants to merge 1 commit into from

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Jul 26, 2016

WIP-ish PR. Interested to see if there are any parts that are objectionable.

I'm happy to split it into smaller chunks for different types of lint issues, with nice commit messages.

Also, I can add more fine tuning by implementing my own flake8-putty, which allows rules to be disabled per-file and even per-line without modifying the source, so new rules can be enforced for new code while existing lint errors in old code are ignored.


This change is Reviewable

@gsnedders
Copy link
Member

In general, <3. Thanks for doing this! I'm pretty sure I'd rather not have some of the changes because I disagree with the lint, but I think that's a small number of the changes; will have a close look through tomorrow.

FWIW, there was some vague intent to just get rid of flake8-run.sh given it's pretty gratuitous now. Also, when it comes to pylint, if we're going to have it in Travis/tox we should probably pin it to one exact version to avoid breakage when it gets updated (this really goes for flake8 and its dependencies too, but I've far more experience of pylint changing things like the disable strings from version-to-version).

@jayvdb
Copy link
Contributor Author

jayvdb commented Jul 27, 2016

No worries. Im just waking up, so I'll focus on cleaning up only the actual provable user-facing bugs herein until I hear more from you.


import urllib.request
import urllib.error
import urllib.parse
import urllib.robotparser
import md5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing this change turned into a mini project #294 .

@jayvdb
Copy link
Contributor Author

jayvdb commented Jul 28, 2016

I split off the CI and pylint changes to be #293.

@willkg willkg added this to the 1.0 milestone Oct 3, 2017
@willkg
Copy link
Contributor

willkg commented Nov 29, 2017

@jayvdb We've landed a bunch of changes, but I'm a little fuzzy on whether all the important things in this PR have been covered now or not. Are there outstanding things we want in this PR or can we close it out?

@jayvdb
Copy link
Contributor Author

jayvdb commented Nov 29, 2017

Quite a few parts are now simpler, but still heaps to do. I rebased and revised this last week, but was waiting for the other PRs to be merged, and was doing Google Code-in launch prep.
I'll push my revised version asap.

@willkg willkg removed this from the 1.0 milestone Dec 4, 2017
@willkg
Copy link
Contributor

willkg commented Dec 4, 2017

I want to get 1.0.0 out, so I'm going to drop this from the milestone.

Thank you for working on it! We can definitely land this in the future.

@hugovk
Copy link
Contributor

hugovk commented Nov 8, 2019

At this point in time, I'd suggest just running Black and let it decide on the style choices.

@gsnedders
Copy link
Member

gsnedders commented Feb 26, 2020

@hugovk Let's try and minimise the number of open PRs when we do that (i.e., wait till after we've merged many of the currently open PRs), given it'll cause conflicts with everything, but yes, applying black seems sane. (Keeping this open in lieu of opening a new issue because I'm about to go to bed 🙃)

@ambv
Copy link
Member

ambv commented Mar 1, 2023

I think this is too outdated with the current state of the code to recover. Too many conflicts. Re-open if you think I'm wrong.

List of conflicts from an attempt to merge
CONFLICT (modify/delete): .travis.yml deleted in master and modified in HEAD.  Version HEAD of .travis.yml left in tree.
Auto-merging debug-info.py
Auto-merging html5lib/_inputstream.py
CONFLICT (content): Merge conflict in html5lib/_inputstream.py
Auto-merging html5lib/_tokenizer.py
Auto-merging html5lib/_utils.py
CONFLICT (content): Merge conflict in html5lib/_utils.py
Auto-merging html5lib/filters/sanitizer.py
CONFLICT (content): Merge conflict in html5lib/filters/sanitizer.py
Auto-merging html5lib/html5parser.py
CONFLICT (content): Merge conflict in html5lib/html5parser.py
Auto-merging html5lib/serializer.py
Auto-merging html5lib/tests/conftest.py
CONFLICT (content): Merge conflict in html5lib/tests/conftest.py
Auto-merging html5lib/tests/support.py
Auto-merging html5lib/tests/test_encoding.py
Auto-merging html5lib/tests/test_parser2.py
Auto-merging html5lib/tests/test_serializer.py
CONFLICT (content): Merge conflict in html5lib/tests/test_serializer.py
Auto-merging html5lib/tests/test_stream.py
Auto-merging html5lib/tests/test_treewalkers.py
CONFLICT (content): Merge conflict in html5lib/tests/test_treewalkers.py
Auto-merging html5lib/tests/tokenizer.py
Auto-merging html5lib/treeadapters/__init__.py
Auto-merging html5lib/treeadapters/genshi.py
Auto-merging html5lib/treeadapters/sax.py
CONFLICT (content): Merge conflict in html5lib/treeadapters/sax.py
Auto-merging html5lib/treebuilders/__init__.py
CONFLICT (content): Merge conflict in html5lib/treebuilders/__init__.py
Auto-merging html5lib/treebuilders/base.py
CONFLICT (content): Merge conflict in html5lib/treebuilders/base.py
Auto-merging html5lib/treebuilders/etree_lxml.py
Auto-merging parse.py
CONFLICT (content): Merge conflict in parse.py
Auto-merging requirements-test.txt
CONFLICT (content): Merge conflict in requirements-test.txt
Auto-merging setup.py
Auto-merging tox.ini
CONFLICT (content): Merge conflict in tox.ini
Auto-merging utils/entities.py
CONFLICT (modify/delete): utils/spider.py deleted in master and modified in HEAD.  Version HEAD of utils/spider.py left in tree.
Automatic merge failed; fix conflicts and then commit the result.

In general, while I'm a big supporter of linting, I feel like flake8 and pylint cover a lot of the same ground and using both in a project is too much.

I agree with @hugovk that after we go over the other open PRs in the repo we should adopt auto-formatting, which would further cut down on the needed lint rules.

Then I'd figure out what the lowest supported Python version should be for html5lib going forward.

Finally, after all that we can return to refine the adopted linting.

@ambv ambv closed this Mar 1, 2023
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.

5 participants