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

Fix lint issues and lint config #219

Merged
merged 1 commit into from Nov 20, 2023

Conversation

greyli
Copy link
Member

@greyli greyli commented Nov 17, 2023

For the two ignored rules:

  • E731: It's OK to use lambda
  • W504: W503 and W504 are conflicts with each other, we need to disable one of them.

Copy link
Contributor

@macnewbold macnewbold left a comment

Choose a reason for hiding this comment

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

Makes sense to me. The inherent conflict between 503 and 504 is interesting, but it sounds like you've already evaluated which one is less problematic for our current code base.

Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

Thanks for handling the drudgery of these!

@jeffwidman jeffwidman merged commit 62ce443 into pallets-eco:master Nov 20, 2023
1 of 10 checks passed
jeffwidman pushed a commit that referenced this pull request Nov 21, 2023
1. Update the test app

If I understand correctly, the debug toolbar will only be enabled if `app.debug` is `True`. So I added the `DEBUG=True` to the test app.

Related code: https://github.com/pallets-eco/flask-debugtoolbar/blob/2b8bf9cc449a95f442b99dfdfb6147fa1ae2230a/src/flask_debugtoolbar/__init__.py#L114

2. Update the `src/flask_debugtoolbar/__init__.py`

Fix the two if statements to prevent the following errors:

```
>       if 'gzip' in response.headers.get('Content-Encoding'):
E       TypeError: argument of type 'NoneType' is not iterable
```

Since the `response.headers.get('Content-Encoding')` could be None.

With this PR, all the tests will be passed. The failed style checker will be fixed in #219
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants