Skip to content

Commit

Permalink
Merge pull request #57 from TheoMF/directory_option_2_#52
Browse files Browse the repository at this point in the history
Directory option solution 2
  • Loading branch information
nim65s authored Aug 17, 2023
2 parents 6af2cfa + c4a67f1 commit b825d18
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: Install gepetuto and its dependencies
run: python -m pip install -U pip && python -m pip install .
- name: check with gepetuto
run: cd tests && gepetuto -vvca all
run: gepetuto -vvca all -C tests
- name: run unit tests
run: cd tests && python -m unittest
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- add directory argument

## [v1.1.1] - 2023-08-16

- updated pre-commit hooks
Expand Down
9 changes: 9 additions & 0 deletions gepetuto/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ def parse_args(args=None) -> argparse.Namespace:
action="store_true",
help="check if linters change files.",
)
parser.add_argument(
"-C",
"--directory",
default="",
help="choose directory to run action on.",
)

args = parser.parse_args(args=args)

Expand Down Expand Up @@ -134,6 +140,9 @@ def get_files(args):
def main():
"""Run command."""
args = parse_args()
if args.directory:
os.chdir(args.directory)
args = parse_args()
files = get_files(args)
if args.action == "generate":
generate(**vars(args))
Expand Down

0 comments on commit b825d18

Please sign in to comment.