refactor: pre-commit run
This commit is contained in:
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -21,4 +21,3 @@ jobs:
|
||||
coverage xml
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v2
|
||||
|
||||
|
||||
@@ -19,4 +19,4 @@ repos:
|
||||
rev: 5.10.1
|
||||
hooks:
|
||||
- id: isort
|
||||
args: ["--filter-files" ]
|
||||
args: ["--filter-files" ]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Contributing
|
||||
Any issues and PRs are welcome.
|
||||
|
||||
Development environment recommendations are in Readme.md
|
||||
Development environment recommendations are in Readme.md
|
||||
|
||||
@@ -22,7 +22,7 @@ Other methods are not supporting:
|
||||
**Security notice.**
|
||||
This application uses SSH as git transport layer.
|
||||
It is safe enough with right use,
|
||||
and for right use you need to save
|
||||
and for right use you need to save
|
||||
git server ssh digest (~/.ssh/known_hosts file).
|
||||
To do this you just need to clone any repository over ssh first
|
||||
|
||||
@@ -92,4 +92,4 @@ Token as the only one identifier is _good enough_ for 95% cases.
|
||||
|
||||
- **A:** Using libraries for specific cases is a good practice in industry.
|
||||
And it keeps code simple and easy to verify (for bugs or malicious actions).
|
||||
Which is much more important than one-time venv or Docker setup.
|
||||
Which is much more important than one-time venv or Docker setup.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import os.path
|
||||
import sys
|
||||
from src.gitea_api import GiteaApi
|
||||
from src.repository_name import get_repository_name, is_valid_repository_names
|
||||
from src.config import Config, read_ini_config
|
||||
from src.models import GiteaRepository
|
||||
from src.git import git_pull, git_clone
|
||||
|
||||
from os import makedirs
|
||||
|
||||
from src.config import Config, read_ini_config
|
||||
from src.git import git_clone, git_pull
|
||||
from src.gitea_api import GiteaApi
|
||||
from src.models import GiteaRepository
|
||||
from src.repository_name import get_repository_name, is_valid_repository_names
|
||||
|
||||
BASE_PATH = "out"
|
||||
FORMAT = "{owner}/{name}"
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@ include = '.pyi?$'
|
||||
profile = "black"
|
||||
py_version = "auto"
|
||||
sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
|
||||
known_local_folder = "src"
|
||||
known_local_folder = "src"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
pytest~=7.1.1
|
||||
pytest-cov~=3.0.0
|
||||
pytest-cov~=3.0.0
|
||||
|
||||
@@ -14,6 +14,7 @@ ssh_key=/home/user/.ssh/id_rsa.pub
|
||||
|
||||
import configparser
|
||||
import os
|
||||
|
||||
from .models import Config
|
||||
|
||||
MAIN_SECTION = "main"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from typing import List
|
||||
from .models import GiteaRepository
|
||||
from urllib.parse import urljoin
|
||||
from pydantic import parse_obj_as
|
||||
|
||||
|
||||
import requests
|
||||
from pydantic import parse_obj_as
|
||||
|
||||
from .models import GiteaRepository
|
||||
|
||||
|
||||
class GiteaApi:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
import datetime
|
||||
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
|
||||
|
||||
class Config(BaseModel):
|
||||
repository_format: str
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from .models import GiteaRepository, GiteaUser
|
||||
import datetime
|
||||
|
||||
from typing import List
|
||||
|
||||
from .models import GiteaRepository, GiteaUser
|
||||
|
||||
|
||||
def _get_test_repository() -> GiteaRepository:
|
||||
return GiteaRepository(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from .models import GiteaRepository
|
||||
|
||||
from typing import List
|
||||
|
||||
from .models import GiteaRepository
|
||||
|
||||
|
||||
class SyncProcessor:
|
||||
def __init__(self):
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
from src.config import read_ini_config, Config
|
||||
|
||||
import pytest
|
||||
|
||||
from src.config import Config, read_ini_config
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"config_data, expected",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import pytest
|
||||
|
||||
from src.repository_name import is_valid_format
|
||||
|
||||
|
||||
@@ -11,4 +12,4 @@ from src.repository_name import is_valid_format
|
||||
]
|
||||
)
|
||||
def test_name_formatting(name_format, expected):
|
||||
assert is_valid_format(name_format) == expected
|
||||
assert is_valid_format(name_format) == expected
|
||||
|
||||
Reference in New Issue
Block a user