Skip to content

Commit

Permalink
Merge pull request #72 from beatsbears/v2.0.2
Browse files Browse the repository at this point in the history
2.0.2 bump
  • Loading branch information
beatsbears authored Nov 6, 2022
2 parents 0bcd383 + e3aacae commit c60da65
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 2.0.2
- Use temp-dir for cache files
- Fix HTML report generation on Windows
- Fix `exclude_dir` configu bug

## 2.0.1
- Fixed issue where policies not being specified within the .ochrona.yml caused a TypeError

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ There is an empty `.ochrona.yml` file included in the repo.
| Key | Description | Type | Example |
|-|-|-|-|
| `dir` | Directory to recursively search for dependencies files to scan [.] | path | /User/me/my_project |
| `exclude_dir` | Directory names that should be excluded from recursive search. | list | build |
| `exclude_dir` | Directory names that should be excluded from recursive search. | array | build |
| `file` | Single dependency file to scan | file | /User/me/my_project/requirements.txt |
| `debug` | Enable debug logging [false] | bool | true |
| `silent` | Silent mode [false] | bool | true |
Expand Down
2 changes: 1 addition & 1 deletion ochrona/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__author__ = "Andrew Scott"
__email__ = "[email protected]"
__version__ = "2.0.1"
__version__ = "2.0.2"
__license__ = "MIT"
16 changes: 12 additions & 4 deletions ochrona/file/file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,32 @@
def rfind_all_dependencies_files(
logger: OchronaLogger,
directory: Optional[str] = None,
excluded_directories: Optional[str] = None,
excluded_directories: Optional[Union[List[str], str]] = None,
file_obj: Optional[Union[IO, str]] = None,
) -> List[str]:
"""
Recursively searches for dependency files to analyze
:param logger: A configured `OchronaFormatter` instance
:param directory: str - starting directory (optional)
:param excluded_directories: list - directories to exclude
:param file_obj: A specified file to use
:return: list - list of paths for files to analyze
"""
if not directory:
directory = os.getcwd()

files = []
directories_to_exclude = (
excluded_directories.split(",") if isinstance(excluded_directories, str) else []
)

# if this is somehow still a string, let's fix that
if excluded_directories:
directories_to_exclude = (
excluded_directories.split(",")
if isinstance(excluded_directories, str)
else excluded_directories
)
else:
directories_to_exclude = []

if file_obj:
if isinstance(file_obj, str):
Expand Down

0 comments on commit c60da65

Please sign in to comment.