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
|
coverage xml
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v2
|
uses: codecov/codecov-action@v2
|
||||||
|
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ repos:
|
|||||||
rev: 5.10.1
|
rev: 5.10.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
args: ["--filter-files" ]
|
args: ["--filter-files" ]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Contributing
|
# Contributing
|
||||||
Any issues and PRs are welcome.
|
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.**
|
**Security notice.**
|
||||||
This application uses SSH as git transport layer.
|
This application uses SSH as git transport layer.
|
||||||
It is safe enough with right use,
|
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).
|
git server ssh digest (~/.ssh/known_hosts file).
|
||||||
To do this you just need to clone any repository over ssh first
|
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.
|
- **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).
|
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 os.path
|
||||||
import sys
|
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 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"
|
BASE_PATH = "out"
|
||||||
FORMAT = "{owner}/{name}"
|
FORMAT = "{owner}/{name}"
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ include = '.pyi?$'
|
|||||||
profile = "black"
|
profile = "black"
|
||||||
py_version = "auto"
|
py_version = "auto"
|
||||||
sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
|
sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
|
||||||
known_local_folder = "src"
|
known_local_folder = "src"
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
pytest~=7.1.1
|
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 configparser
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from .models import Config
|
from .models import Config
|
||||||
|
|
||||||
MAIN_SECTION = "main"
|
MAIN_SECTION = "main"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
from .models import GiteaRepository
|
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
from pydantic import parse_obj_as
|
|
||||||
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
from pydantic import parse_obj_as
|
||||||
|
|
||||||
|
from .models import GiteaRepository
|
||||||
|
|
||||||
|
|
||||||
class GiteaApi:
|
class GiteaApi:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from pydantic import BaseModel, Field, HttpUrl
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
from pydantic import BaseModel, Field, HttpUrl
|
||||||
|
|
||||||
|
|
||||||
class Config(BaseModel):
|
class Config(BaseModel):
|
||||||
repository_format: str
|
repository_format: str
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from .models import GiteaRepository, GiteaUser
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
from .models import GiteaRepository, GiteaUser
|
||||||
|
|
||||||
|
|
||||||
def _get_test_repository() -> GiteaRepository:
|
def _get_test_repository() -> GiteaRepository:
|
||||||
return GiteaRepository(
|
return GiteaRepository(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from .models import GiteaRepository
|
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
from .models import GiteaRepository
|
||||||
|
|
||||||
|
|
||||||
class SyncProcessor:
|
class SyncProcessor:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
|
|
||||||
from src.config import read_ini_config, Config
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from src.config import Config, read_ini_config
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"config_data, expected",
|
"config_data, expected",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from src.repository_name import is_valid_format
|
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):
|
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