Skip to content

Commit

Permalink
Handle non-text file gracefully (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdguy authored Feb 23, 2022
1 parent a969afd commit 7dea706
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: 🐞 Bug Report
description: File a bug report
title: "[Bug]: <title>"
labels: ["bug"]
assignees:
- insightsengineering/idr
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -43,7 +41,7 @@ body:
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: python
render: Python
- type: checkboxes
id: terms
attributes:
Expand Down
2 changes: 1 addition & 1 deletion presidio_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


APP_NAME = "presidio_cli"
APP_VERSION = "0.0.5"
APP_VERSION = "0.0.6"
APP_DESCRIPTION = __doc__
SHELL_NAME = "presidio"

Expand Down
7 changes: 5 additions & 2 deletions presidio_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ def find_files_recursively(items, conf):
for root, dirnames, filenames in os.walk(item):
for f in filenames:
filepath = os.path.join(root, f)
if conf.is_text_file(filepath):
yield filepath
try:
if conf.is_text_file(filepath):
yield filepath
except UnicodeDecodeError:
pass # Found non-text data
else:
yield item

Expand Down

2 comments on commit 7dea706

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage

Coverage Report
FileStmtsMissCover
presidio_cli
   init.py90100%
   analyzer.py47198%
   cli.py1462285%
   config.py76495%
TOTAL2782790%

Tests Skipped Failures Errors Time
22 0 💤 0 ❌ 0 🔥 43.213s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage

Coverage Report
FileStmtsMissCover
presidio_cli
   init.py90100%
   analyzer.py47198%
   cli.py1462285%
   config.py76495%
TOTAL2782790%

Tests Skipped Failures Errors Time
22 0 💤 0 ❌ 0 🔥 61.366s ⏱️

Please sign in to comment.