Skip to content

Commit

Permalink
Merge pull request #54 from fix/regex-pattern
Browse files Browse the repository at this point in the history
The regex pattern being used to validate if a module-path was a Github
repository did not allow for underscores in the user/repository name

Fixes the miss, also adds `.DS_Store` to .gitignore — for this project,
and for generated projects!

Signed-off-by: notsatan <[email protected]>
  • Loading branch information
notsatan committed Feb 5, 2024
2 parents e146f9e + 7657694 commit 168aa85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.idea/
.vscode/
venv/

.DS_Store/**
2 changes: 1 addition & 1 deletion hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def is_module_hosted_on_github():
"""

# Regex pattern to validate module name - might need some tweaks
pattern = r"^github.com\/[a-zA-Z0-9\-]+\/[a-zA-Z0-9\-]+\/?$"
pattern = r"^github.com\/[\w\-]+\/[\w\-]+\/?$"

# If the user has not opted for Github-specific features, skip
perform_check: bool = bool(
Expand Down
3 changes: 3 additions & 0 deletions {{ cookiecutter.project_name.strip() }}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
.vscode/**
.idea/**

# Mac only
.DS_Store/**

# Ignore directories containing binaries generated and other stuff
tmp/**
bin/**
Expand Down

0 comments on commit 168aa85

Please sign in to comment.