Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ if mods:
"
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Check code for instances of os.remove' ; echo $MSG
invgrep -R --include="*.py*" --exclude "common.py" --exclude "test_writers.py" --exclude "test_store.py" -E "os.remove" pandas/tests/
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to escape the . in os.remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so? os.remove is detected without escaping the . when files containing it are not excluded

Copy link
Member

@MarcoGorelli MarcoGorelli Oct 14, 2020

Choose a reason for hiding this comment

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

OK but like this I think it'll also detect e.g. oszremove. You'll need to escape the . else it'll match anything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, got ya. Changed.

Copy link
Member

Choose a reason for hiding this comment

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

cool, thanks - I'm not sure about the location of the check though, as it's currently inside the "checks on imported code" section. Should it be in "looking for unwanted patterns"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I've shifted it up to the 'patterns' section

RET=$(($RET + $?)) ; echo $MSG "DONE"

fi

### DOCTESTS ###
Expand Down