Skip to content

Commit

Permalink
Merge pull request #2776 from pre-commit/unsorted-additional-deps
Browse files Browse the repository at this point in the history
remove sorting for repo key for additional_deps
  • Loading branch information
asottile authored Feb 23, 2023
2 parents cdd3606 + a631abd commit 7bfa7e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pre_commit/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _state_filename_v2(venv: str) -> str:


def _state(additional_deps: Sequence[str]) -> object:
return {'additional_dependencies': sorted(additional_deps)}
return {'additional_dependencies': additional_deps}


def _read_state(venv: str) -> object | None:
Expand Down
2 changes: 1 addition & 1 deletion pre_commit/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def connect(
@classmethod
def db_repo_name(cls, repo: str, deps: Sequence[str]) -> str:
if deps:
return f'{repo}:{",".join(sorted(deps))}'
return f'{repo}:{",".join(deps)}'
else:
return repo

Expand Down
2 changes: 1 addition & 1 deletion tests/store_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_create_when_store_already_exists(store):

def test_db_repo_name(store):
assert store.db_repo_name('repo', ()) == 'repo'
assert store.db_repo_name('repo', ('b', 'a', 'c')) == 'repo:a,b,c'
assert store.db_repo_name('repo', ('b', 'a', 'c')) == 'repo:b,a,c'


def test_local_resources_reflects_reality():
Expand Down

0 comments on commit 7bfa7e1

Please sign in to comment.