Files
Zamil Majdyandmajdyz 92416fadac [AGPT-556] Overhaul code-validation design + Add PyRight in commented mode (#139)
This is a large but a much needed change to allow more sophisticated static code analysis to be added.

PyRight (used by pylance) will allow us to detect:

Misuse of async functions.
Misuse of optional type and other annotated types.
Wrong usage of pydantic and prisma model.
Wrong usage of third-party library.
The overhaul is required to allow us retrying while fixing the code as a project (not only as a function) and allow us to keep adding non-LLM fixes to it so that we can avoid wasting the retry.

The scope of this PR is still a refactoring and the adding of the PyRight linter, so this PR try to keep the existing behaviour.
The enablement and more tuning on the linter will be done in the followup PR.

---------

Co-authored-by: majdyz <[email protected]>
2024-03-21 13:28:17 +04:00

20 lines
656 B
Python

PRISMA_FILE_HEADER = """
// datasource db defines the database connection settings.
// It is configured for PostgreSQL and uses an environment variable for the connection URL.
// The 'extensions' feature enables the use of PostgreSQL-specific data types.
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
// generator db configures Prisma Client settings.
// It is set up to use Prisma Client Python with asyncio interface and specific features.
generator db {
provider = "prisma-client-py"
interface = "asyncio"
recursive_type_depth = 5
previewFeatures = ["postgresqlExtensions"]
}
"""