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

Added get_callee() which determines the right routine of the return values of get_callees() #2775

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

schreiberx
Copy link
Collaborator

It does what's in the title.

@arporter
Copy link
Member

Thanks @schreiberx, unfortunately, linting is still failing.

In case it helps, I have the following pre-push hook setup:

$ cat PSyclone/.git/hooks/pre-push
#!/usr/bin/sh

# An example hook script to verify what is about to be pushed.  Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed.  If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
#   <local ref> <local oid> <remote ref> <remote oid>
#
# This script ensures that the whole of PSyclone is linted successfully
# before the push is executed.

remote="$1"
url="$2"

if ! command -v flake8; then
    echo "WARNING: source not linted because flake8 unavailable"
    exit 0
fi

flake8=$(flake8 src/psyclone)
if (( flake8 == 1 )); then
    echo "Linting failed"
else
    echo "Linting succeeded"
fi
exit $flake8

@schreiberx
Copy link
Collaborator Author

Hi Andy, Thanks for this script.
I think that all these helper scripts should be part of psyclone to quickly run them over the source code. I added this script in the newest pushed version in bin_git/run_flake8.sh.
Cheers,
Martin

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 96.36364% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.87%. Comparing base (8336dd6) to head (e5cf0db).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
src/psyclone/psyir/nodes/call.py 96.36% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2775   +/-   ##
=======================================
  Coverage   99.87%   99.87%           
=======================================
  Files         356      356           
  Lines       49449    49500   +51     
=======================================
+ Hits        49385    49440   +55     
+ Misses         64       60    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arporter arporter added under review PSyIR Core PSyIR functionality labels Nov 14, 2024
@arporter
Copy link
Member

@schreiberx please could you hold off making further changes until I pass it back to you? It's hard to review if code changes underneath me while I'm doing it :-)

@schreiberx
Copy link
Collaborator Author

These changes are only addressing increasing the coverage to 100% since the codecov bot complained with "Please review."
I'll keep my hands off for now :-)

Copy link
Member

@arporter arporter left a comment

Choose a reason for hiding this comment

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

Thanks very much for this Martin. I like the new routine making use of the existing functionality, that seems sensible. I did struggle to get my head around it so you'll see I've requested that some comments be tweaked or added.
As I say in the review, I think a little work on the frontend for those situations where we hit OPTIONAL could really help here.
The only thing I'm really not sure of is the passing around of the list of integers. That seems a bit odd so I'd like to understand why you do that.
I've not looked at the test suite yet (but thanks for addressing the missed lines).

README.md Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@@ -0,0 +1,43 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding this. I think it should live in utils/example_git_hooks/. If the plan is that a user simply alters the githook to call this script then please say that in L6-8. Alternatively, we could provide it as a drop-in hook that a user would just copy to .git/hooks/pre-push. I don't mind either way but please update the comment. We also need to document this hooks existence in the Developer Guide. I think we need a brief new section under https://psyclone-dev.readthedocs.io/en/latest/working_practises.html#working-with-psyclone-from-github - possibly "git integration" or something? This could be cross-referenced from the section that mentions linting in the Continuous Integration part.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For me, that's not directly git related - although you used it as git hooks.
It's about good coding styles and scripts that help one ensure this.
In addition, this can also be used by git and the CI system.
Therefore, I'd just put this directly into the ./utils folder. I also added a run_pytest_cov.sh script.

bin_git/run_flake8.sh Outdated Show resolved Hide resolved
src/psyclone/psyir/nodes/call.py Outdated Show resolved Hide resolved
src/psyclone/psyir/nodes/call.py Show resolved Hide resolved
src/psyclone/psyir/nodes/call.py Show resolved Hide resolved
src/psyclone/psyir/nodes/call.py Outdated Show resolved Hide resolved
src/psyclone/psyir/nodes/call.py Show resolved Hide resolved
src/psyclone/psyir/nodes/call.py Outdated Show resolved Hide resolved
@arporter
Copy link
Member

Back to @schreiberx :-)

@schreiberx
Copy link
Collaborator Author

Back to @arporter :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PSyIR Core PSyIR functionality reviewed with actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants