Skip to content

Commit

Permalink
Ensure that language validation works on all supported languages (#459)
Browse files Browse the repository at this point in the history
The database has a set of enum validation which is different from the
in-code validation that we do when checking that the language is valid.
This should ensure that the language set looks the same.
  • Loading branch information
michelletran-codecov authored Jan 2, 2025
1 parent abc6b36 commit 7935e52
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions shared/torngit/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import httpx

from shared.django_apps.core.models import Repository
from shared.torngit.cache import torngit_cache
from shared.torngit.enums import Endpoints
from shared.torngit.response_types import ProviderPull
Expand Down Expand Up @@ -38,28 +39,7 @@ class TorngitBaseAdapter(object):
_token: Token | None = None
verify_ssl = None

valid_languages = (
"javascript",
"shell",
"python",
"ruby",
"perl",
"dart",
"java",
"c",
"clojure",
"d",
"fortran",
"go",
"groovy",
"kotlin",
"php",
"r",
"scala",
"swift",
"objective-c",
"xtend",
)
valid_languages = set(language.value for language in Repository.Languages)

def __init__(
self,
Expand Down

0 comments on commit 7935e52

Please sign in to comment.