-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Metrics: fix metric base type, Add report interface for report and support functions #17
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,34 +30,34 @@ jobs: | |
run: | | ||
poetry install | ||
|
||
# - name: Run Tests | ||
# run: | | ||
# make test | ||
|
||
# - name: Persist Coverage | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: coverage | ||
# path: | | ||
# coverage.xml | ||
# .coverage | ||
|
||
# coverage: | ||
# needs: [test] | ||
# name: coverage | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Load coverage artifact | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: coverage | ||
# - name: Push coverage report | ||
# uses: paambaati/[email protected] | ||
# env: | ||
# CC_TEST_REPORTER_ID: ${{secrets.REPORTER_ID}} | ||
# with: | ||
# prefix: ${{github.workspace}} | ||
# coverageLocations: | | ||
# ${{github.workspace}}/.coverage/:coverage.py | ||
# ${{github.workspace}}/coverage.xml/:coverage.py | ||
- name: Run Tests | ||
run: | | ||
make test | ||
|
||
- name: Persist Coverage | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage | ||
path: | | ||
coverage.xml | ||
.coverage | ||
|
||
coverage: | ||
needs: [test] | ||
name: coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Load coverage artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage | ||
- name: Push coverage report | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{secrets.REPORTER_ID}} | ||
with: | ||
prefix: ${{github.workspace}} | ||
coverageLocations: | | ||
${{github.workspace}}/.coverage/:coverage.py | ||
${{github.workspace}}/coverage.xml/:coverage.py |
This file was deleted.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import logging | ||
from pathlib import Path | ||
from typing import Optional | ||
|
||
import typer | ||
from typer import Context | ||
|
||
from asunder.utils.logging import get_logger_console | ||
from asunder.utils.checks import is_url | ||
from asunder.utils.data import search_repo_data | ||
from asunder.report.report import generate_report | ||
|
||
app = typer.Typer(add_completion=True, no_args_is_help=True) | ||
|
||
logger = logging.getLogger("asunder") | ||
|
||
|
||
@app.command(no_args_is_help=True) | ||
def extract( | ||
ctx: Context, | ||
path: Path = typer.Option(Path.cwd(), help="path or url to package source code"), | ||
repo_token: Optional[str] = typer.Option( | ||
None, | ||
"--git-token", | ||
envvar="GITHUB_TOKEN", | ||
help="Git personal access token for repository analysis", | ||
), | ||
) -> None: | ||
logger, console = get_logger_console() | ||
|
||
dry_run = ctx.obj.get("dry_run", True) | ||
|
||
logger.info("Analyzing Repository") | ||
if is_url: | ||
logger.error("Online Analysis not implemented") | ||
typer.Exit(code=1) | ||
# analyze github or gitlab pull/merge requests, issues | ||
if not repo_token: | ||
raise ValueError( | ||
"token required for repository analysis of pull requests and issues, you can define the env variable GITHUB_TOKEN" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line too long (130 > 79 characters) |
||
) | ||
if not path.exists(): | ||
logger.error(f"Error: Path not found: {path}") | ||
raise typer.Exit(code=1) | ||
# project = Project(path=path, console=console) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this commented out code. |
||
|
||
repo_data = search_repo_data(path) | ||
generate_report(repo_data) | ||
if not dry_run: | ||
logger.info("Perfoming Changes") | ||
# perfom changes | ||
|
||
typer.Exit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line too long (85 > 79 characters)