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

Fixed bug where webpage opens on bad paths #878

Merged

Conversation

sushimon
Copy link
Contributor

@sushimon sushimon commented Feb 14, 2023

Motivation and Context

Calls to check_all and check_errors generate an error report when we pass in a path that doesn't exist or is unreadable.

Your Changes

Description:

  • PythonTA no longer opens a webpage under these conditions but still prints the error message to the console.
  • Added some logic to ensure at least one file has been checked before generating reports.
  • Updated CHANGELOG.md to document this bug fix.

Type of change (select all that apply):

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • Ran the tests in the test suite and verified they passed.
  • Ran python in pyta repository and called check_all and check_errors (in reality, they both use the same helper method) with erroneous inputs (both files and directories) and verified that an error message was displayed but no webpage opened. Also tested with different PythonTA reporters.
  • Also tested the check_all and check_errors methods with valid inputs and verified this change did not affect the messages being displayed (e.g. removing some by accident).
  • Previewed the CHANGELOG.md file to verify it now includes information related to this bug fix.

Questions and Comments (if applicable)

  • As of now, the PR for the ForbiddenPythonSyntaxChecker hasn't been merged so once it does, there will might be a merge conflict with the CHANGELOG.md files so that needs to be dealt with

Checklist

  • I have performed a self-review of my own code.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported on Coveralls.
  • I have updated the CHANGELOG.md file.

@sushimon sushimon changed the title Updated the conditions for __init__.py to generate reports Fixed bug where webpage opens on bad paths Feb 14, 2023
@sushimon sushimon marked this pull request as ready for review February 14, 2023 04:35
CHANGELOG.md Outdated Show resolved Hide resolved
python_ta/__init__.py Outdated Show resolved Hide resolved
@david-yz-liu david-yz-liu merged commit 320db76 into pyta-uoft:master Mar 11, 2023
@sushimon sushimon deleted the bugfix-webpage-open-on-bad-path branch March 22, 2023 16:01
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.

2 participants