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

Killing the last inconsistencies through type hints #1052

Merged
merged 13 commits into from
Jan 25, 2024
Merged

Conversation

hugsy
Copy link
Owner

@hugsy hugsy commented Jan 20, 2024

Description

This PR is purely esthetic but fixes a few extra inconsistencies thanks to type hints, using pylint and pylance.
Both pass now reporting no error, warning or info!

Among other fixes:

  • removed unused vars
  • f-string-ify more
  • enforce (using assert) expected type to variable when appropriate
  • fixed some bad type names in gdb.events.*
  • the config manager allows to receive non basic types
  • applied all the type issues spotted by pylance using the gdb.pyi stub
  • a lot of staticmethod have been made non static because we can use gef.gdb.commands["XXX"] instead

With this PR :

  • pylint on gef and tests/*.py shows a 10/10 score

image

  • pylance shows no error

image

Checklist

  • My code follows the code style of this project.
  • My change includes a change to the documentation, if required.
  • If my change adds new code, adequate tests have been added.
  • I have read and agree to the CONTRIBUTING document.

Copy link

🤖 Coverage update for 1c3504e 🔴

Old New
Commit 219d46f 1c3504e
Score 71.7764% 71.6686% (-0.1078)

Copy link

🤖 Coverage update for 1c3504e 🟢

Old New
Commit 219d46f 1c3504e
Score 71.7764% 71.7959% (0.0195)

@hugsy hugsy marked this pull request as ready for review January 21, 2024 22:30
@hugsy hugsy added this to the 2024.05 milestone Jan 21, 2024
Copy link

🤖 Coverage update for e0c15b1 🔴

Old New
Commit 219d46f e0c15b1
Score 71.7764% 71.6547% (-0.1217)

Copy link

🤖 Coverage update for e0c15b1 🟢

Old New
Commit 219d46f e0c15b1
Score 71.7764% 71.7764% (0)

Copy link

🤖 Coverage update for 0b6ad3b 🔴

Old New
Commit 219d46f 0b6ad3b
Score 71.7764% 71.5865% (-0.1899)

Copy link

🤖 Coverage update for 0b6ad3b 🟢

Old New
Commit 219d46f 0b6ad3b
Score 71.7764% 71.7764% (0)

Copy link

🤖 Coverage update for 45caca7 🔴

Old New
Commit 219d46f 45caca7
Score 71.7764% 71.5893% (-0.1871)

Copy link

🤖 Coverage update for 45caca7 🟢

Old New
Commit 219d46f 45caca7
Score 71.7764% 71.7764% (0)

@hugsy hugsy changed the title Killing more inconsistencies through type hints Killing the last inconsistencies through type hints Jan 25, 2024
Copy link

🤖 Coverage update for 2b11d83 🟢

Old New
Commit 219d46f 2b11d83
Score 71.7764% 71.7959% (0.0195)

Copy link

🤖 Coverage update for 2b11d83 🔴

Old New
Commit 219d46f 2b11d83
Score 71.7764% 71.5623% (-0.2141)

tests/commands/gef.py Outdated Show resolved Hide resolved
tests/config/__init__.py Show resolved Hide resolved
Copy link

🤖 Coverage update for 0d90912 🔴

Old New
Commit 219d46f 0d90912
Score 71.7569% 71.5623% (-0.1946)

Copy link

🤖 Coverage update for 0d90912 🟢

Old New
Commit 219d46f 0d90912
Score 71.7569% 71.8153% (0.0584)

@hugsy hugsy merged commit 570cc03 into main Jan 25, 2024
6 checks passed
@hugsy hugsy deleted the more_type_hint_bugfixes branch January 25, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants