Skip to content

gh-66079: IDLE: Ability to run 3rd party code checkers #9802

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taleinat
Copy link
Contributor

@taleinat taleinat commented Oct 11, 2018

This is based on Saimadhav Heblikar's latest patch on the issues tracker.

I've updated it to work based on current master. Specifically, it is now implemented as an integral part of IDLE rather than as an extension, and the configuration is added to the main config dialog.

I'm putting this up to allow others to review and give feedback before I move towards finalizing this. This is why this is still missing tests and some polish.

https://bugs.python.org/issue21880

@csabella
Copy link
Contributor

Hi @taleinat! I've just started looking at this and it's going to take me some time to go through, but I have one question. ConfigCheckerDialog is commented out in checkers.py and added to configdialog.py. Was there a reason you wanted it there and not in query.py? Thanks!

@@ -111,11 +112,13 @@ def create_widgets(self):
self.fontpage = FontPage(note, self.highpage)
self.keyspage = KeysPage(note)
self.genpage = GenPage(note)
self.chckpage = CheckersPage(note)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if chckpage has any advantage over checkpage.

nameLabel = Label(optionsFrame, text='Name of Checker')
commandLabel = Label(optionsFrame, text='Command')
additionalLabel = Label(optionsFrame, text='Additional Args')
currentCallStringLabel = Label(optionsFrame,
Copy link
Contributor

@csabella csabella Oct 13, 2018

Choose a reason for hiding this comment

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

The recent changes to configdialog have taken out the use of Label (and most other widget types) in the variable name. Some of them like list and frame are still used because it clarifies the usage.

Edit: Although label is used in query.py.

self.focus_set()
# frames creation
optionsFrame = Frame(self)
buttonFrame = Frame(self)
Copy link
Contributor

@csabella csabella Oct 13, 2018

Choose a reason for hiding this comment

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

options_frame and buttons_frame would be preferable. I think we're trying to convert IDLE over to PEP8 and away from camel case unless it's a class.

call_string = ''
self.vars['call_string'].set(call_string)

def is_name_ok(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

query.py dropped the is and just uses name_ok.

"in {location} in {menu} menu, before running "
"'{checker}' again.".format(checker=checker,
location=location,
menu=menu))
Copy link
Contributor

@csabella csabella Oct 13, 2018

Choose a reason for hiding this comment

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

You should be able to just use an f-string anywhere you've used format.

title = 'Config new checker'
self.wm_title(title)
self.geometry('+%d+%d' % (parent.winfo_rootx() + 30,
parent.winfo_rooty() + 30))
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use an f-string here too.

if 'run' in self.menudict:
self.checkers_menu = Menu(self.menubar, tearoff=0)
self.menudict['run'].insert_cascade(3, label='Code Checkers',
menu=self.checkers_menu)
Copy link
Contributor

@csabella csabella Oct 13, 2018

Choose a reason for hiding this comment

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

I think this should be included in mainmenu.py and then the menu populated like helpmenu is in the lines just below this. One thing though -- if there aren't any checkers, the menu item still appears, but hovering shows nothing. I think there should be a default of <None> that's greyed out or something similar so that it looks like the hovering is working.

FWIW, I have an open PR that adds some tests to the editor for the menus. BPO issue 31529. I need to rebase the PR.

@taleinat
Copy link
Contributor Author

taleinat commented Oct 13, 2018

@csabella

Thanks for the review and comments!

I took the existing patch from the issue tracker, got it into working condition and posted here to allow for review and feedback. I'll be sure to address all of the issues you've highlighted if the decision is made that we'd like to have this feature.

ConfigCheckerDialog is commented out in checkers.py and added to configdialog.py. Was there a reason you wanted it there and not in query.py? Thanks!

No good reason, I wouldn't mind moving it there if you and @terryjreedy think that's appropriate.

@hauntsaninja hauntsaninja changed the title bpo-21880: IDLE: Ability to run 3rd party code checkers gh-66079: IDLE: Ability to run 3rd party code checkers Jan 7, 2023
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review DO-NOT-MERGE stale Stale PR or inactive for long period of time. type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants