Skip to content

Commit

Permalink
Merge pull request #294 from jxdv/typos
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
christophetd authored Jan 12, 2024
2 parents c9006b8 + 3acaf1e commit faf0947
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion guarddog/analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def _format_semgrep_response(self, response, rule=None, targetpath=None):
response (dict): response from Semgrep
rule (str, optional): name of rule to format. Defaults to all rules.
targetpath (str, optional): root directory of scan. Defaults to None.
Paths in formatted resonse will be rooted from targetpath.
Paths in formatted response will be rooted from targetpath.
Returns:
dict: formatted response in the form...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def exclude_result(file_name, repo_root, pkg_root):
"""
This method filters out some results that are known false positives:
* if the file is a documentation file (based on its extension)
* if the fil is an setup.cfg file with the egg_info claim present on Pypi and not on GitHub
* if the file is a setup.cfg file with the egg_info claim present on Pypi and not on GitHub
"""
for extension in EXCLUDED_EXTENSIONS:
if file_name.endswith(extension):
Expand Down Expand Up @@ -260,7 +260,7 @@ def detect(self, package_info, path: Optional[str] = None, name: Optional[str] =
raise Exception(f"Error while cloning repository {str(git_error)} with github url {github_url}")
except Exception as e:
# Catch any other unexpected exceptions
raise Exception(f"An unexpected error occured: {str(e)}. github url {github_url}")
raise Exception(f"An unexpected error occurred: {str(e)}. github url {github_url}")

tag_candidates = find_suitable_tags(repo, version)

Expand All @@ -273,7 +273,7 @@ def detect(self, package_info, path: Optional[str] = None, name: Optional[str] =
target_tag = tag

# Idea: parse the code of the package to find the real version - we can grep the project files for
# the version, git biscect until we have a file with the same version? will not work if main has not
# the version, git bisect until we have a file with the same version? will not work if main has not
# been bumped yet in version so tags and releases are out only solutions here print(tag_candidates)
# Well, that works if we run integrity check for multiple commits

Expand Down
2 changes: 1 addition & 1 deletion guarddog/analyzer/metadata/typosquatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class TyposquatDetector(Detector):
MESSAGE_TEMPLATE = "This package closely ressembles the following package names, and might be a typosquatting " \
MESSAGE_TEMPLATE = "This package closely resembles the following package names, and might be a typosquatting " \
"attempt: %s"

def __init__(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion guarddog/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def display_result(result: dict) -> None:
def is_local_target(identifier: str) -> bool:
"""
@param identifier: The name/path of the package as passed to "guarddog ecosystem scan"
@return: Whether the identifier should be consider a local path
@return: Whether the identifier should be considered a local path
"""
if identifier.startswith("/") or identifier.startswith("./") or identifier.startswith("../"):
return True
Expand Down

0 comments on commit faf0947

Please sign in to comment.