Skip to content

run ruff format to fix whitespace changes#16803

Merged
seanbudd merged 4 commits intomasterfrom
ruffFormat
Jul 4, 2024
Merged

run ruff format to fix whitespace changes#16803
seanbudd merged 4 commits intomasterfrom
ruffFormat

Conversation

@seanbudd
Copy link
Copy Markdown
Member

@seanbudd seanbudd commented Jul 3, 2024

Must be merge commit not squash merge

Link to issue number:

Follow up to #16767
Closes #12261

Summary of the issue:

When migrating to ruff in #16751, we failed to lint scons files, and also run ruff format on the repository.
Ruff format fixes whitespaces issues in python files.

Description of user facing changes

None

Description of development approach

Perform lint fixes on scons files and run ruff format.

# lint scons files
ruff check --fix
ruff check --add-noqa

# add trailing commas
pre-commit run --all-files add-trailing-comma

# format and re lint
ruff format
ruff check --fix
ruff check --add-noqa

Testing strategy:

Known issues with pull request:

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai ignore

Summary by CodeRabbit

  • Refactor

    • Updated code formatting for consistency and readability across multiple scripts.
    • Standardized string delimiters to double quotes in various scripts.
    • Simplified function signatures and command calls for better code clarity.
  • Style

    • Made comments compliant with PEP 8 guidelines.
    • Improved alignment and spacing in variable assignments and import statements.

@seanbudd seanbudd requested a review from a team as a code owner July 3, 2024 05:40
@seanbudd seanbudd requested a review from SaschaCowley July 3, 2024 05:40
@seanbudd
Copy link
Copy Markdown
Member Author

seanbudd commented Jul 3, 2024

@coderabbitai ignore

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 3, 2024

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

This update mainly focuses on improving code readability and maintainability by enforcing consistent formatting, refactoring functions, and refining comments. The changes span multiple files with an emphasis on converting single quotes to double quotes, aligning code with PEP 8 guidelines, and enhancing the overall clarity of the codebase. No significant changes in logic or functionality have been introduced.

Changes

Files Change Summary
.git-blame-ignore-revs Added new commits related to linting the repository with Ruff.
appveyor/crowdinSync.py Refactored functions and simplified the code structure for improved readability.
appveyor/mozillaSyms.py Updated string delimiters to double quotes and adjusted list comprehensions and print statements.
appx/sconscript, nvdaHelper/ISimpleDOM_sconscript Converted comments to PEP 8, updated string quotes, and adjusted spacing for better readability.
cldrDict_sconscript Updated string quotes and added noqa directives to ignore undefined names.
extras/controllerClient/examples/example_python.py Changed SSML content string delimiters to double quotes for consistency.
nvdaHelper/UIARemote/sconscript, .../..._sconscript Adjusted comments, updated formatting, and changed single quotes to double quotes for string literals.
nvdaHelper/archBuild_sconscript, .../..._sconscript Refactored imports, adjusted function definitions, and enhanced environment settings and compiler flags.
nvdaHelper/local/sconscript, .../..._sconscript Added spaces, aligned assignments, and made formatting changes for better code readability.
nvdaHelper/localWin10/sconscript Updated import statements, adjusted string formatting, and refactored handling of error messages.
nvdaHelper/mathPlayer_sconscript Adjusted command declarations, function calls, and updated string formatting to improve code clarity.
nvdaHelper/remote/sconscript Added noqa comments, aligned assignments, and formatted lists for enhanced code readability.

Tip

AI model upgrade

gpt-4o model for reviews and chat is now live

OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our Discord Community to provide any feedback or to report any issues.


Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b47fdc5 and 4924981.

Files selected for processing (57)
  • .git-blame-ignore-revs (1 hunks)
  • appveyor/crowdinSync.py (2 hunks)
  • appveyor/mozillaSyms.py (3 hunks)
  • appx/sconscript (1 hunks)
  • cldrDict_sconscript (1 hunks)
  • extras/controllerClient/examples/example_python.py (1 hunks)
  • nvdaHelper/ISimpleDOM_sconscript (1 hunks)
  • nvdaHelper/UIARemote/sconscript (1 hunks)
  • nvdaHelper/acrobatAccess_sconscript (1 hunks)
  • nvdaHelper/archBuild_sconscript (1 hunks)
  • nvdaHelper/client/sconscript (2 hunks)
  • nvdaHelper/detours/sconscript (1 hunks)
  • nvdaHelper/espeak/sconscript (11 hunks)
  • nvdaHelper/ia2_sconscript (1 hunks)
  • nvdaHelper/liblouis/sconscript (4 hunks)
  • nvdaHelper/local/sconscript (7 hunks)
  • nvdaHelper/localWin10/sconscript (2 hunks)
  • nvdaHelper/mathPlayer_sconscript (1 hunks)
  • nvdaHelper/remote/sconscript (8 hunks)
  • nvdaHelper/remoteLoader/sconscript (1 hunks)
  • nvdaHelper/sconscript (1 hunks)
  • nvdaHelper/vbufBackends/adobeAcrobat/sconscript (1 hunks)
  • nvdaHelper/vbufBackends/gecko_ia2/sconscript (1 hunks)
  • nvdaHelper/vbufBackends/lotusNotesRichText/sconscript (1 hunks)
  • nvdaHelper/vbufBackends/mshtml/sconscript (1 hunks)
  • nvdaHelper/vbufBackends/webKit/sconscript (1 hunks)
  • nvdaHelper/vbufBase/sconscript (1 hunks)
  • projectDocs/dev/developerGuide/conf.py (6 hunks)
  • projectDocs/dev/developerGuide/sconscript (1 hunks)
  • sconstruct (11 hunks)
  • site_scons/site_tools/doxygen.py (2 hunks)
  • site_scons/site_tools/gettextTool.py (1 hunks)
  • site_scons/site_tools/listModules.py (3 hunks)
  • site_scons/site_tools/md2html.py (6 hunks)
  • site_scons/site_tools/msrpc.py (1 hunks)
  • site_scons/site_tools/recursiveInstall.py (2 hunks)
  • source/COMRegistrationFixes/init.py (1 hunks)
  • source/IAccessibleHandler/init.py (31 hunks)
  • source/IAccessibleHandler/internalWinEventHandler.py (3 hunks)
  • source/IAccessibleHandler/orderedWinEventLimiter.py (4 hunks)
  • source/IAccessibleHandler/types.py (1 hunks)
  • source/IAccessibleHandler/utils.py (3 hunks)
  • source/JABHandler.py (12 hunks)
  • source/NVDAHelper.py (13 hunks)
  • source/NVDAObjects/IAccessible/MSHTML.py (18 hunks)
  • source/NVDAObjects/IAccessible/SysMonthCal32.py (1 hunks)
  • source/NVDAObjects/IAccessible/adobeAcrobat.py (9 hunks)
  • source/NVDAObjects/IAccessible/akelEdit.py (1 hunks)
  • source/NVDAObjects/IAccessible/chromium.py (7 hunks)
  • source/NVDAObjects/IAccessible/delphi.py (1 hunks)
  • source/NVDAObjects/IAccessible/hh.py (2 hunks)
  • source/NVDAObjects/IAccessible/ia2TextMozilla.py (20 hunks)
  • source/NVDAObjects/IAccessible/ia2Web.py (17 hunks)
  • source/NVDAObjects/IAccessible/mozilla.py (9 hunks)
  • source/NVDAObjects/IAccessible/msOffice.py (7 hunks)
  • source/NVDAObjects/IAccessible/mscandui.py (2 hunks)
  • source/NVDAObjects/IAccessible/qt.py (4 hunks)
Files not processed due to max files limit (20)
  • source/NVDAObjects/IAccessible/scintilla.py
  • source/NVDAObjects/IAccessible/sysListView32.py
  • source/NVDAObjects/IAccessible/sysTreeView32.py
  • source/NVDAObjects/IAccessible/webKit.py
  • source/NVDAObjects/IAccessible/winConsole.py
  • source/NVDAObjects/IAccessible/winword.py
  • source/NVDAObjects/JAB/init.py
  • source/NVDAObjects/UIA/VisualStudio.py
  • source/NVDAObjects/UIA/chromium.py
  • source/NVDAObjects/UIA/excel.py
  • source/NVDAObjects/UIA/spartanEdge.py
  • source/NVDAObjects/UIA/sysListView32.py
  • source/NVDAObjects/UIA/web.py
  • source/NVDAObjects/UIA/winConsoleUIA.py
  • source/NVDAObjects/UIA/wordDocument.py
  • source/NVDAObjects/init.py
  • source/NVDAObjects/behaviors.py
  • source/NVDAObjects/inputComposition.py
  • source/NVDAObjects/lockscreen.py
  • source/NVDAObjects/window/init.py
Files not summarized due to errors (2)
  • source/JABHandler.py: Error: Message exceeds token limit
  • source/NVDAObjects/IAccessible/MSHTML.py: Error: Message exceeds token limit
Files skipped from review due to trivial changes (27)
  • .git-blame-ignore-revs
  • appveyor/crowdinSync.py
  • appx/sconscript
  • cldrDict_sconscript
  • extras/controllerClient/examples/example_python.py
  • nvdaHelper/client/sconscript
  • nvdaHelper/detours/sconscript
  • nvdaHelper/ia2_sconscript
  • nvdaHelper/liblouis/sconscript
  • nvdaHelper/local/sconscript
  • nvdaHelper/mathPlayer_sconscript
  • nvdaHelper/remote/sconscript
  • nvdaHelper/remoteLoader/sconscript
  • nvdaHelper/sconscript
  • nvdaHelper/vbufBackends/gecko_ia2/sconscript
  • nvdaHelper/vbufBackends/webKit/sconscript
  • site_scons/site_tools/doxygen.py
  • site_scons/site_tools/recursiveInstall.py
  • source/COMRegistrationFixes/init.py
  • source/IAccessibleHandler/types.py
  • source/IAccessibleHandler/utils.py
  • source/NVDAObjects/IAccessible/SysMonthCal32.py
  • source/NVDAObjects/IAccessible/adobeAcrobat.py
  • source/NVDAObjects/IAccessible/akelEdit.py
  • source/NVDAObjects/IAccessible/hh.py
  • source/NVDAObjects/IAccessible/ia2TextMozilla.py
  • source/NVDAObjects/IAccessible/qt.py
Additional context used
Path-based instructions (30)
nvdaHelper/vbufBase/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

source/NVDAObjects/IAccessible/delphi.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

nvdaHelper/vbufBackends/lotusNotesRichText/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

nvdaHelper/vbufBackends/mshtml/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

nvdaHelper/vbufBackends/adobeAcrobat/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

nvdaHelper/UIARemote/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

nvdaHelper/acrobatAccess_sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

site_scons/site_tools/gettextTool.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

projectDocs/dev/developerGuide/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

nvdaHelper/localWin10/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

nvdaHelper/ISimpleDOM_sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

site_scons/site_tools/listModules.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

site_scons/site_tools/msrpc.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

appveyor/mozillaSyms.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

projectDocs/dev/developerGuide/conf.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/IAccessibleHandler/orderedWinEventLimiter.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

site_scons/site_tools/md2html.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/NVDAObjects/IAccessible/chromium.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/NVDAObjects/IAccessible/msOffice.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

nvdaHelper/archBuild_sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

source/NVDAObjects/IAccessible/mozilla.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/NVDAObjects/IAccessible/mscandui.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/IAccessibleHandler/internalWinEventHandler.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/NVDAObjects/IAccessible/ia2Web.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

nvdaHelper/espeak/sconscript (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

sconstruct (1)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.

source/NVDAHelper.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/JABHandler.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/NVDAObjects/IAccessible/MSHTML.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/IAccessibleHandler/__init__.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious.


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

Additional comments not posted (245)
nvdaHelper/vbufBase/sconscript (3)

1-5: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comments are appropriate for suppressing linting errors related to undefined names.


7-14: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comments are appropriate for suppressing linting errors related to undefined names.


16-16: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comment is appropriate for suppressing linting errors related to undefined names.

source/NVDAObjects/IAccessible/delphi.py (6)

6-12: Defining TRichView class.

The TRichView class defines the role as STATICTEXT and has a placeholder for the name.


14-20: Defining TRichViewEdit class.

The TRichViewEdit class defines the role as EDITABLETEXT and has a placeholder for the name.


22-24: Defining TGroupBox class.

The TGroupBox class defines the role as GROUPING.


26-28: Defining Form class.

The Form class defines the role as DIALOG.


30-32: Defining TabSheet class.

The TabSheet class defines the role as PROPERTYPAGE.


34-36: Defining TRxRichEdit class.

The TRxRichEdit class has a placeholder for the name.

nvdaHelper/vbufBackends/lotusNotesRichText/sconscript (3)

15-19: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comments are appropriate for suppressing linting errors related to undefined names.


21-21: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comment is appropriate for suppressing linting errors related to undefined names.


23-23: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comment is appropriate for suppressing linting errors related to undefined names.

nvdaHelper/vbufBackends/mshtml/sconscript (3)

15-19: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comments are appropriate for suppressing linting errors related to undefined names.


21-23: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comments are appropriate for suppressing linting errors related to undefined names.


26-26: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comment is appropriate for suppressing linting errors related to undefined names.

nvdaHelper/vbufBackends/adobeAcrobat/sconscript (3)

15-20: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comments are appropriate for suppressing linting errors related to undefined names.


22-24: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comments are appropriate for suppressing linting errors related to undefined names.


27-27: Suppressing undefined name errors using # noqa: F821.

The added # noqa: F821 comment is appropriate for suppressing linting errors related to undefined names.

nvdaHelper/UIARemote/sconscript (4)

2-12: Documentation: Ensure License URL is up-to-date.

Verify that the URL provided for the GNU General Public License is current and accurate.


15-20: LGTM: Import statement with noqa.

The import statement is correctly updated with # noqa: F821 to ignore undefined name errors.


22-35: LGTM: SharedLibrary definition with noqa.

The env.SharedLibrary call is correctly updated with # noqa: F821 to ignore undefined name errors.


36-36: LGTM: Return statement with noqa.

The return statement is correctly updated with # noqa: F821 to ignore undefined name errors.

nvdaHelper/acrobatAccess_sconscript (5)

2-12: Documentation: Ensure License URL is up-to-date.

Verify that the URL provided for the GNU General Public License is current and accurate.


15-15: LGTM: Import statement with noqa.

The import statement is correctly updated with # noqa: F821 to ignore undefined name errors.


17-21: LGTM: Command definition with noqa.

The env.Command call is correctly updated with # noqa: F821 to ignore undefined name errors.


23-23: LGTM: TypeLibrary call with noqa.

The env.TypeLibrary call is correctly updated with # noqa: F821 to ignore undefined name errors.


25-25: LGTM: Return statement with noqa.

The return statement is correctly updated with # noqa: F821 to ignore undefined name errors.

site_scons/site_tools/gettextTool.py (2)

2-12: Documentation: Ensure License URL is up-to-date.

Verify that the URL provided for the GNU General Public License is current and accurate.


20-32: LGTM: Builder definition.

The gettextMoFile builder is correctly defined and formatted.

projectDocs/dev/developerGuide/sconscript (9)

8-8: LGTM: Import statement with noqa.

The import statement is correctly updated with # noqa: F821 to ignore undefined name errors.


10-10: LGTM: Clone environment with noqa.

The env.Clone call is correctly updated with # noqa: F821 to ignore undefined name errors.


12-12: LGTM: Directory creation with noqa.

The outputDir.Dir call is correctly updated with # noqa: F821 to ignore undefined name errors.


15-19: LGTM: Command definition with noqa.

The env.Command call is correctly updated with # noqa: F821 to ignore undefined name errors.


23-30: LGTM: Doxygen documentation generation with noqa.

The env.Doxygen and env.Command calls are correctly updated with # noqa: F821 to ignore undefined name errors.


33-46: LGTM: Ignore paths definition.

The ignorePaths list is correctly defined and formatted.


51-65: LGTM: Sphinx API docs generation with noqa.

The env.Command call is correctly updated with # noqa: F821 to ignore undefined name errors.


70-80: LGTM: Sphinx HTML generation with noqa.

The env.Command call is correctly updated with # noqa: F821 to ignore undefined name errors.


82-84: LGTM: Final command definitions with noqa.

The env.Command, env.Alias, and env.Clean calls are correctly updated with # noqa: F821 to ignore undefined name errors.

nvdaHelper/localWin10/sconscript (6)

Line range hint 2-12: Documentation: Ensure License URL is up-to-date.

Verify that the URL provided for the GNU General Public License is current and accurate.


20-23: LGTM: Import statement with noqa.

The import statement is correctly updated with # noqa: F821 to ignore undefined name errors.


26-26: LGTM: Clone environment with noqa.

The env.Clone call is correctly updated with # noqa: F821 to ignore undefined name errors.


33-41: LGTM: SharedLibrary definition with noqa.

The env.SharedLibrary call is correctly updated with # noqa: F821 to ignore undefined name errors.


49-70: LGTM: vcRedistDirs handling.

The logic for handling vcRedistDirs is correctly implemented and formatted.


72-72: LGTM: Return statement with noqa.

The return statement is correctly updated with # noqa: F821 to ignore undefined name errors.

nvdaHelper/ISimpleDOM_sconscript (10)

2-12: Ensure license and copyright information is up-to-date.

While the license information is correct, ensure that the dates and URLs are current.


15-15: No issues with import statement.

The import statement has been updated to use double quotes, aligning with the rest of the file.


17-17: No issues with MIDLCOM assignment.

The assignment of env["MIDLCOM"] has been updated to use double quotes, maintaining consistency.


21-30: No issues with env.Command calls.

The env.Command calls have been updated to use double quotes. The logic remains unchanged.


34-39: No issues with Substfile call.

The env.Substfile call has been updated to use double quotes. The logic remains unchanged.


43-43: No issues with env.Depends call.

The env.Depends call has been updated to use double quotes. The logic remains unchanged.


45-47: No issues with TypeLibrary assignment.

The env.TypeLibrary call has been updated to use double quotes. The logic remains unchanged.


51-53: No issues with Ignore call.

The env.Ignore call has been updated to use double quotes. The logic remains unchanged.


55-61: No issues with COMProxyDll call.

The env.COMProxyDll call has been updated to use double quotes. The logic remains unchanged.


62-62: No issues with Return statement.

The Return statement has been updated to use double quotes. The logic remains unchanged.

site_scons/site_tools/listModules.py (3)

15-15: No issues with function signature update.

The function _generateModuleList has been updated with type annotations. This improves readability and ensures type safety.


43-48: No issues with module path conversion.

The code for converting file paths to Python module format has been updated for clarity. The logic remains unchanged.


61-62: No issues with GenerateModuleList builder.

The GenerateModuleList builder has been updated with type annotations. This improves readability and ensures type safety.

site_scons/site_tools/msrpc.py (5)

2-12: Ensure license and copyright information is up-to-date.

While the license information is correct, ensure that the dates and URLs are current.


22-30: No issues with MSRPCStubs_buildEmitter function.

The MSRPCStubs_buildEmitter function has been updated with double quotes. The logic remains unchanged.


33-69: No issues with MSRPCStubs_builder_actionGenerator function.

The MSRPCStubs_builder_actionGenerator function has been updated with double quotes and minor formatting changes. The logic remains unchanged.


72-74: No issues with MSRPCStubs_builder definition.

The MSRPCStubs_builder definition has been updated with double quotes. The logic remains unchanged.


78-92: No issues with exists and generate functions.

The exists and generate functions have been updated with double quotes and minor formatting changes. The logic remains unchanged.

appveyor/mozillaSyms.py (10)

21-21: No issues with URL assignment.

The URL assignment has been updated to use double quotes. The logic remains unchanged.


30-35: No issues with DLL_FILES assignment.

The DLL_FILES assignment has been updated to use double quotes. The logic remains unchanged.


45-50: No issues with check_output function.

The check_output function has been updated with double quotes and minor formatting changes. The logic remains unchanged.


53-59: No issues with processFile function.

The processFile function has been updated with double quotes and minor formatting changes. The logic remains unchanged.


66-66: No issues with sym_file assignment.

The sym_file assignment has been updated to use double quotes. The logic remains unchanged.


74-82: No issues with generate function.

The generate function has been updated with double quotes and minor formatting changes. The logic remains unchanged.


96-98: No issues with requests.post call.

The requests.post call has been updated to use double quotes. The logic remains unchanged.


105-105: No issues with allErrors assignment.

The allErrors assignment has been updated to use double quotes. The logic remains unchanged.


109-114: No issues with upload function.

The upload function has been updated with double quotes and minor formatting changes. The logic remains unchanged.


120-120: No issues with main block.

The if __name__ == "__main__": block has been updated to use double quotes. The logic remains unchanged.

projectDocs/dev/developerGuide/conf.py (9)

12-12: No issues with _appDir assignment.

The _appDir assignment has been updated to use double quotes. The logic remains unchanged.


27-27: No issues with comtypesMonkeyPatches calls.

The comtypesMonkeyPatches calls have been updated to use double quotes. The logic remains unchanged.


33-33: No issues with setLanguage call.

The setLanguage call has been updated to use double quotes. The logic remains unchanged.


Line range hint 53-65: No issues with versionInfo usage.

The versionInfo assignments and calls have been updated to use double quotes. The logic remains unchanged.


73-73: No issues with default_role assignment.

The default_role assignment has been updated to use double quotes. The logic remains unchanged.


79-79: No issues with extensions list.

The extensions list has been updated to use double quotes. The logic remains unchanged.


83-83: No issues with templates_path list.

The templates_path list has been updated to use double quotes. The logic remains unchanged.


88-88: No issues with exclude_patterns list.

The exclude_patterns list has been updated to use double quotes. The logic remains unchanged.


Line range hint 103-113: No issues with autodoc configuration.

The autodoc configuration has been updated with double quotes and minor formatting changes. The logic remains unchanged.

source/IAccessibleHandler/orderedWinEventLimiter.py (4)

17-17: Minor formatting improvement

The whitespace adjustment here improves readability.


44-44: Minor formatting improvement

The whitespace adjustment here maintains consistency with the rest of the file.


77-77: Minor formatting improvement

The whitespace adjustment here improves readability.


108-108: Minor formatting improvement

The whitespace adjustment here improves readability.

site_scons/site_tools/md2html.py (6)

16-17: Minor formatting improvement

The whitespace adjustment here improves readability.


60-60: Minor formatting improvement

The whitespace adjustment here maintains consistency with the rest of the file.


92-92: Minor formatting improvement

The whitespace adjustment here improves readability.


126-126: Minor formatting improvement

The whitespace adjustment here improves readability.


149-149: Minor formatting improvement

The whitespace adjustment here improves readability.


222-222: Minor formatting improvement

The whitespace adjustment here improves readability.

source/NVDAObjects/IAccessible/chromium.py (7)

6-7: Minor formatting improvement

The whitespace adjustment here improves readability.


64-69: Minor formatting improvement

The whitespace adjustment here improves readability.


91-91: Minor formatting improvement

The whitespace adjustment here improves readability.


106-106: Minor formatting improvement

The whitespace adjustment here improves readability.


171-172: Minor formatting improvement

The whitespace adjustment here improves readability.


180-180: Minor formatting improvement

The whitespace adjustment here improves readability.


184-184: Minor formatting improvement

The whitespace adjustment here improves readability.

source/NVDAObjects/IAccessible/msOffice.py (23)

19-19: Minor formatting improvement

The whitespace adjustment here improves readability.


23-25: Minor formatting improvement

The whitespace adjustment here improves readability.


28-30: Minor formatting improvement

The whitespace adjustment here improves readability.


34-36: Minor formatting improvement

The whitespace adjustment here improves readability.


39-43: Minor formatting improvement

The whitespace adjustment here improves readability.


50-52: Minor formatting improvement

The whitespace adjustment here improves readability.


56-58: Minor formatting improvement

The whitespace adjustment here improves readability.


62-64: Minor formatting improvement

The whitespace adjustment here improves readability.


69-82: Minor formatting improvement

The whitespace adjustment here improves readability.


87-87: Minor formatting improvement

The whitespace adjustment here improves readability.


92-92: Minor formatting improvement

The whitespace adjustment here improves readability.


96-98: Minor formatting improvement

The whitespace adjustment here improves readability.


101-104: Minor formatting improvement

The whitespace adjustment here improves readability.


107-108: Minor formatting improvement

The whitespace adjustment here improves readability.


118-120: Minor formatting improvement

The whitespace adjustment here improves readability.


141-146: Minor formatting improvement

The whitespace adjustment here improves readability.


Line range hint 148-159: Minor formatting improvement

The whitespace adjustment here improves readability.


168-169: Minor formatting improvement

The whitespace adjustment here improves readability.


171-175: Minor formatting improvement

The whitespace adjustment here improves readability.


178-187: Minor formatting improvement

The whitespace adjustment here improves readability.


191-191: Minor formatting improvement

The whitespace adjustment here improves readability.


Line range hint 203-220: Minor formatting improvement

The whitespace adjustment here improves readability.


226-226: Minor formatting improvement

The whitespace adjustment here improves readability.

nvdaHelper/archBuild_sconscript (35)

6-7: Minor formatting improvement

The whitespace adjustment here improves readability.


20-23: Minor formatting improvement

The whitespace adjustment here improves readability.


36-37: Minor formatting improvement

The whitespace adjustment here improves readability.


41-43: Minor formatting improvement

The whitespace adjustment here improves readability.


45-50: Minor formatting improvement

The whitespace adjustment here improves readability.


55-60: Minor formatting improvement

The whitespace adjustment here improves readability.


63-65: Minor formatting improvement

The whitespace adjustment here improves readability.


70-73: Minor formatting improvement

The whitespace adjustment here improves readability.


79-87: Minor formatting improvement

The whitespace adjustment here improves readability.


91-91: Minor formatting improvement

The whitespace adjustment here improves readability.


93-100: Minor formatting improvement

The whitespace adjustment here improves readability.


105-108: Minor formatting improvement

The whitespace adjustment here improves readability.


112-113: Minor formatting improvement

The whitespace adjustment here improves readability.


114-118: Minor formatting improvement

The whitespace adjustment here improves readability.


120-129: Minor formatting improvement

The whitespace adjustment here improves readability.


130-132: Minor formatting improvement

The whitespace adjustment here improves readability.


134-139: Minor formatting improvement

The whitespace adjustment here improves readability.


140-149: Minor formatting improvement

The whitespace adjustment here improves readability.


151-154: Minor formatting improvement

The whitespace adjustment here improves readability.


157-159: Minor formatting improvement

The whitespace adjustment here improves readability.


165-171: Minor formatting improvement

The whitespace adjustment here improves readability.


173-177: Minor formatting improvement

The whitespace adjustment here improves readability.


179-180: Minor formatting improvement

The whitespace adjustment here improves readability.


182-185: Minor formatting improvement

The whitespace adjustment here improves readability.


187-193: Minor formatting improvement

The whitespace adjustment here improves readability.


195-200: Minor formatting improvement

The whitespace adjustment here improves readability.


202-204: Minor formatting improvement

The whitespace adjustment here improves readability.


206-207: Minor formatting improvement

The whitespace adjustment here improves readability.


209-210: Minor formatting improvement

The whitespace adjustment here improves readability.


212-220: Minor formatting improvement

The whitespace adjustment here improves readability.


226-227: Minor formatting improvement

The whitespace adjustment here improves readability.


229-233: Minor formatting improvement

The whitespace adjustment here improves readability.


235-239: Minor formatting improvement

The whitespace adjustment here improves readability.


241-245: Minor formatting improvement

The whitespace adjustment here improves readability.


247-249: Minor formatting improvement

The whitespace adjustment here improves readability.

source/NVDAObjects/IAccessible/mozilla.py (5)

43-43: Import statement looks good.

The import of supportedAriaDetailsRoles from .chromium is necessary for the role property.


44-44: Code logic looks good.

The logic to check detailsRole and log debug information is correctly implemented.


64-64: Field addition looks good.

The addition of _originObj field in MozAnnotation class is necessary for the class methods and properties.


71-71: Method update looks good.

The __bool__ method correctly checks detailsRelations and returns a boolean value.


128-133: Method update looks good.

The _get_presentationType method correctly updates the presType based on new conditions.

source/NVDAObjects/IAccessible/mscandui.py (13)

14-14: Whitespace change looks good.

The addition of a new line before the reportSelectedCandidate function improves code readability.


24-26: Function update looks good.

The reportSelectedCandidate function correctly handles the candidate object and its container.


35-37: Class addition looks good.

The BaseCandidateItem class correctly defines properties and methods for a candidate item.


40-43: Method update looks good.

The _get_candidateNumber method correctly handles the candidate number and exceptions.


48-51: Method update looks good.

The _get_parent method correctly sets the parent name and description.


56-60: Method update looks good.

The _get_name method correctly handles the candidate number and returns the formatted candidate name.


63-63: Method update looks good.

The _get_description method correctly returns the formatted candidate description.


67-67: Method update looks good.

The _get_basicText method correctly returns the candidate name.


72-74: Method update looks good.

The _get_states method correctly adds the selectable state to the candidate list item.


81-97: Class addition looks good.

The MSCandUI21_candidateMenuItem class correctly defines methods for candidate menu item navigation and actions.


100-107: Method update looks good.

The doAction method correctly handles the action based on the item location.


111-114: Method update looks good.

The script_nextItem method correctly handles the navigation to the next item.


123-136: Method update looks good.

The script_changePage method correctly handles the page change and reports the selected candidate.

source/IAccessibleHandler/internalWinEventHandler.py (1)

104-106: Function update looks good.

The winEventCallback function correctly handles invalid window handles and updates the window to desktop window if necessary.

source/NVDAObjects/IAccessible/ia2Web.py (8)

6-6: Docstring addition looks good.

The docstring provides a brief description of the file's purpose.


26-26: Import statement looks good.

The import of Dialog and WebDialog from NVDAObjects.behaviors is necessary for the findExtraOverlayClasses function.


57-57: Method update looks good.

The __bool__ method correctly checks the details-roles attribute and returns a boolean value.


67-67: Property update looks good.

The targets property correctly returns a tuple of IA2WebAnnotationTarget objects.


82-82: Property update looks good.

The _rolesGenerator property correctly generates roles based on details-roles attribute.


101-101: Attribute addition looks good.

The IAccessibleTableUsesTableCellIndexAttrib and caretMovementDetectionUsesEvents attributes are necessary for the Ia2Web class functionality.


119-124: Method update looks good.

The _get_positionInfo method correctly retrieves and updates the position info.


177-177: Method update looks good.

The _get_placeholder method correctly retrieves the placeholder attribute.

nvdaHelper/espeak/sconscript (12)

13-18: LGTM!

The formatting adjustment for the Import statement improves readability.


26-31: LGTM!

The changes related to defining directory paths using the Dir method are appropriate.


66-77: LGTM!

The changes related to defining the structure of the espeak_VOICE class are appropriate.


Line range hint 82-93: LGTM!

The changes related to defining the structure and documentation of the espeak_AUDIO_OUTPUT class are appropriate.


94-115: LGTM!

The changes related to setting compiler flags for the environment are appropriate.


119-126: LGTM!

The changes related to setting include paths for the environment are appropriate.


129-144: LGTM!

The changes related to defining the build emitter function for phoneme data compilation are appropriate.


146-154: LGTM!

The changes related to defining the build action function for phoneme data compilation are appropriate.


Line range hint 164-183: LGTM!

The changes related to defining the pre-build action function for cleaning files are appropriate.


189-192: LGTM!

The changes related to defining the builder for phoneme data compilation are appropriate.


196-942: LGTM!

The changes related to defining the dictionary for language dictionary compilation are appropriate.


Line range hint 948-1149: LGTM!

The changes related to defining the build action functions and installation commands are appropriate.

sconstruct (10)

Line range hint 17-21: Verify the correctness of the error message.

Ensure that the error message provides accurate and clear instructions for setting up the Python virtual environment.


40-53: Verify the correctness of the version check logic and error message.

Ensure that the version check logic correctly identifies incompatible Python versions and that the error message provides clear instructions for resolving the issue.


55-58: Verify the correctness of the source environment path and import statement.

Ensure that the source environment path is correctly set and that the sourceEnv module is successfully imported.


65-77: Verify the correctness and efficiency of the recursiveCopy function.

Ensure that the recursiveCopy function correctly copies files and directories from the source to the target directory. Consider optimizing the function if necessary.


81-82: Verify the correctness of the gettext installation and usage.

Ensure that the gettext module is correctly installed and configured for internationalization and localization.


95-143: Verify the correctness and completeness of the added variables.

Ensure that all necessary variables are added to the SCons environment and that their default values are correctly set.


160-160: Verify the correctness of the MD5-timestamp decider configuration.

Ensure that the MD5-timestamp decider is correctly configured to speed up subsequent builds.


Line range hint 163-171: Verify the correctness and clarity of the warning message.

Ensure that the warning message provides clear instructions for using the -j option with SCons to utilize all available CPU threads.


217-219: Verify the correctness of the assertion and error message.

Ensure that the assertion correctly checks that both API token and local certificate are not specified for signing, and that the error message provides clear instructions.


263-265: Verify the necessity and correctness of setting the STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME flag.

Ensure that setting the STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME flag is necessary and correctly handles the bug where some tools state that static and shared objects are different.

source/NVDAHelper.py (10)

45-47: Verify the correctness of the path settings.

Ensure that the paths for different library versions are correctly set based on the globalVars.appDir and the buildVersion.version.


57-60: Verify the correctness of the initialization and usage of _remoteLoaderAMD64 and _remoteLoaderARM64.

Ensure that _remoteLoaderAMD64 and _remoteLoaderARM64 are correctly initialized and used for remote loading of libraries.


68-70: Verify the correctness and efficiency of the _setDllFuncPointer function.

Ensure that the _setDllFuncPointer function correctly sets a function pointer in a DLL to a ctypes wrapped Python function. Consider optimizing the function if necessary.


Line range hint 90-152: Verify the correctness and efficiency of the nvdaController_speakSsml function.

Ensure that the nvdaController_speakSsml function correctly speaks SSML text with the specified symbol level, priority, and asynchronous flag. Consider refactoring the function to reduce complexity.


174-179: Verify the correctness of the nvdaController_cancelSpeech function.

Ensure that the nvdaController_cancelSpeech function correctly cancels the current speech.


183-190: Verify the correctness of the nvdaController_brailleMessage function.

Ensure that the nvdaController_brailleMessage function correctly sends a braille message.


196-216: Verify the correctness and efficiency of the _lookupKeyboardLayoutNameWithHexString function.

Ensure that the _lookupKeyboardLayoutNameWithHexString function correctly looks up the keyboard layout name using a hex string. Consider optimizing the function if necessary.


222-252: Verify the correctness of the nvdaControllerInternal_requestRegistration function.

Ensure that the nvdaControllerInternal_requestRegistration function correctly requests registration for a given UUID.


289-292: Verify the correctness of the nvdaControllerInternal_displayModelTextChangeNotify function.

Ensure that the nvdaControllerInternal_displayModelTextChangeNotify function correctly notifies of text changes in the display model.


309-318: Verify the correctness of the nvdaControllerInternal_logMessage function.

Ensure that the nvdaControllerInternal_logMessage function correctly logs a message with the specified level and process ID.

source/JABHandler.py (10)

29-29: Ensure that create_unicode_buffer is used correctly.

The import of create_unicode_buffer is correct and necessary for creating buffers for Unicode strings.


51-52: LGTM! The formatting of A11Y_PROPS_CONTENT is correct.

The content is well-formatted and adheres to the coding standards.


62-72: Ensure _fixBridgeFunc handles errors correctly.

The function sets return and argument types for bridge functions and includes error checking. The changes look correct.


77-82: Definitions of access bridge types are correct.

The definitions for jchar, jint, jfloat, and jboolean are appropriate and necessary for the access bridge.


88-120: Definitions of JOBJECT64 and other structures are correct.

The structures are well-defined and necessary for the access bridge.


125-179: Definitions of additional structures are correct.

The structures such as AccessibleTextInfo and AccessibleTextAttributesInfo are well-defined and necessary.


320-328: Definitions of function pointer types are correct.

The function pointer types such as AccessBridge_FocusGainedFP are well-defined and necessary.


332-476: Ensure _fixBridgeFuncs handles all bridge functions correctly.

The function sets return and argument types for all access bridge functions and includes error checking. The changes look correct.


Line range hint 518-556: Ensure JABContext class handles context management correctly.

The class manages accessible contexts and includes error handling. The changes look correct.


Line range hint 562-822: Ensure JABContext methods handle accessible contexts correctly.

The methods manage accessible contexts and include necessary error handling. The changes look correct.

source/NVDAObjects/IAccessible/MSHTML.py (11)

1-5: LGTM!

The added comments and imports are correct and follow standard practices.


78-107: LGTM!

The changes to the HTMLAttribCache class are correct and improve code readability.


111-147: LGTM!

The changes to the nodeNamesToNVDARoles dictionary are correct and improve code readability.


162-174: LGTM!

The changes to the getZoomFactorsFromHTMLDocument function are correct and improve code readability.


177-197: LGTM!

The changes to the IAccessibleFromHTMLNode and HTMLNodeFromIAccessible functions are correct and improve code readability.


198-243: LGTM!

The changes to the locateHTMLElementByID function are correct and improve code readability.


246-256: LGTM!

The changes to the getChildHTMLNodeFromFrame function are correct and improve code readability.


Line range hint 260-431: LGTM!

The changes to the MSHTMLTextInfo class are correct and improve code readability.


Line range hint 434-1127: LGTM!

The changes to the MSHTML class are correct and improve code readability.


Line range hint 1134-1145: LGTM!

The changes to the V6ComboBox class are correct and improve code readability.


Line range hint 1146-1262: LGTM!

The changes to the Fieldset, Body, Object, PluginWindow, PopupList, RootClient, MSAATextLeaf, and Math classes are correct and improve code readability.

source/IAccessibleHandler/__init__.py (9)

7-7: Approved: Import statement for typing.

The import statement for typing is necessary for type hinting used in the file.


Line range hint 251-255: Approved: Function _getStatesSetFromIAccessibleStates.

The function correctly converts IAccessible states to a set of NVDA states.


272-272: Approved: Local variable IAccessibleStateAttrName.

The variable is used to format state attribute names for IAccessible states.


285-285: Approved: Local variable IAccessible2StateAttrName.

The variable is used to format state attribute names for IAccessible2 states.


294-296: Approved: Docstring for calculateNvdaRole.

The docstring provides a clear description of the function's purpose and parameters.


302-304: Approved: Docstring for calculateNvdaStates.

The docstring provides a clear description of the function's purpose and parameters.


321-322: Approved: Type hints for normalizeIAccessible.

The type hints improve code readability and maintainability.


581-582: Approved: Local variable SDMChild.

The variable is used to handle SDM MSAA objects.


765-765: Approved: Log statement in processDesktopSwitchWinEvent.

The log statement provides useful debugging information.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 3, 2024

@coderabbitai ignore

Actions performed

Reviews paused.

@LeonarddeR
Copy link
Copy Markdown
Collaborator

It looks like ruff collapses several function definitions into one line that were previously split into multiple lines.
I wonder Add-trailing-comma can help us here.

@LeonarddeR
Copy link
Copy Markdown
Collaborator

LeonarddeR commented Jul 3, 2024

Yes, it definitely helps. It leaves single line definitions alone while adding trailing commas to multi line definitions. I think this is exactly what we need to make our formatting a bit more conservative.
To be clear, I suspect it's okay to run add-trailing-comma once, so it doesn't need to be added to the build system.

@coderabbitai what is your opinion about using the add-trailing-comma package from pip?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 3, 2024

Tip

For best results, initiate chat on the files or code changes.

@LeonarddeR, the add-trailing-comma package can indeed be beneficial in this scenario. The package helps maintain multi-line function definitions by adding trailing commas, which can prevent tools like ruff from collapsing them into single lines. This approach aligns with making the formatting more conservative, as it preserves the readability and structure of the code.

Here is how the add-trailing-comma package can be used to achieve this:

  1. Installation: You can install the package via pip:

    pip install add-trailing-comma
  2. Usage: You can run the tool on your codebase to add trailing commas to multi-line function definitions:

    add-trailing-comma path/to/your/code

By integrating add-trailing-comma into your workflow, you can ensure that multi-line function definitions remain properly formatted, enhancing code readability and maintainability.

Would you like to proceed with this approach?

Analysis chain
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Identify the specific instances where `ruff` has collapsed function definitions into one line.
rg --multiline --multiline-dotall 'def .*\n *def ' --files-with-matches

Length of output: 5977


Learnings added
Learnt from: LeonarddeR
URL: https://github.com/nvaccess/nvda/pull/16803

Timestamp: 2024-07-03T06:25:34.127Z
Learning: The `add-trailing-comma` package from pip can be used to add trailing commas to multi-line function definitions, preventing them from being collapsed into single lines by formatting tools like `ruff`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 3, 2024

Tip

For best results, initiate chat on the files or code changes.

@LeonarddeR, the add-trailing-comma package from pip is indeed a suitable solution for this scenario. It effectively prevents tools like ruff from collapsing multi-line function definitions into single lines by adding trailing commas, thereby preserving the readability and structure of the code.

Here is a brief overview of how you can use the add-trailing-comma package:

  1. Installation: Install the package via pip:

    pip install add-trailing-comma
  2. Usage: Run the tool on your codebase to add trailing commas to multi-line function definitions:

    add-trailing-comma path/to/your/code

Running add-trailing-comma once should be sufficient to achieve the desired formatting without the need to integrate it into the build system.

If you have any further questions or need assistance with this approach, feel free to ask!


Learnings added
Learnt from: LeonarddeR
URL: https://github.com/nvaccess/nvda/pull/16803

Timestamp: 2024-07-03T06:26:06.798Z
Learning: The `add-trailing-comma` package from pip can be used to add trailing commas to multi-line function definitions, preventing them from being collapsed into single lines by formatting tools like `ruff`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


Learnings used
Learnt from: LeonarddeR
PR: nvaccess/nvda#0
File: :0-0
Timestamp: 2024-07-03T06:25:34.261Z
Learning: The `add-trailing-comma` package from pip can be used to add trailing commas to multi-line function definitions, preventing them from being collapsed into single lines by formatting tools like `ruff`.

@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit a5318c6ef9

@seanbudd seanbudd marked this pull request as draft July 3, 2024 06:41
@seanbudd
Copy link
Copy Markdown
Member Author

seanbudd commented Jul 3, 2024

blocked by #16804

@seanbudd seanbudd marked this pull request as ready for review July 4, 2024 03:23
@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit c1a575f5ad

@seanbudd seanbudd merged commit 7734274 into master Jul 4, 2024
@seanbudd seanbudd deleted the ruffFormat branch July 4, 2024 04:07
seanbudd added a commit that referenced this pull request Jul 4, 2024
Follow up to #16803

Summary of the issue:
Ruff formatting python code in #16803 caused our translation comments to lose association with translation strings
This causes our scons check to fail.

Description of user facing changes
None

Description of development approach
Move translation comments to reassociated them.
@LeonarddeR LeonarddeR mentioned this pull request Jul 17, 2024
6 tasks
seanbudd pushed a commit that referenced this pull request Aug 1, 2024
Follow up to #16767, #16803
Preparation for #16852

Summary of the issue:
Pre-commit touches several files it shouldn't touch, e.g. symbol dictionaries, translated markdown.

Description of user facing changes
None

Description of development approach
Update Ruff to 0.5.2 in requirements
Add a hook for scons source
Update sconstruct to automatically use the max number of cores when passing -j 0, which can be used with pre-commit to have optimal performance
Run pre-commit autoupdate
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.

Fix a load of linting issues

3 participants