-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ruff linter with ci check (#1178)
* feat: add ruff linter with ci check Liniting the python files in tests directory would reduce whitespace etc change and enforce basic coding standard for those. Kind of opportunistic PR as there might be other opinions about how to deal with this. * fix: format with ruff
- Loading branch information
Showing
9 changed files
with
241 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,26 +4,30 @@ | |
import pytest | ||
from helper import TempRepository | ||
|
||
def create_repo(dirname = None): | ||
|
||
def create_repo(dirname=None): | ||
repo = TempRepository(dirname) | ||
tmp_file_a = repo.create_tmp_file() | ||
tmp_file_b = repo.create_tmp_file() | ||
repo.switch_cwd_under_repo() | ||
return repo | ||
|
||
|
||
def init_repo_git_status(repo): | ||
git = repo.get_repo_git() | ||
git.add(".") | ||
git.config("--local", "user.name", "test") | ||
git.config("--local", "user.email", "[email protected]") | ||
git.commit("-m", "chore: initial commit") | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def temp_repo(): | ||
repo = create_repo() | ||
init_repo_git_status(repo) | ||
return repo | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def named_temp_repo(request): | ||
dirname = request.param | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import os, subprocess | ||
|
||
expected_authors_list = "test <[email protected]>\ntestagain <[email protected]>\n" | ||
expected_authors_list = ( | ||
"test <[email protected]>\ntestagain <[email protected]>\n" | ||
) | ||
expected_authors_list_without_email = "test\ntestagain\n" | ||
authors_file = "AUTHORS" | ||
|
||
|
||
class TestGitAuthors: | ||
def test_init(self, temp_repo): | ||
git = temp_repo.get_repo_git() | ||
|
Oops, something went wrong.