-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/typhonshambo/ai-styleguide
- Loading branch information
Showing
9 changed files
with
49 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from .gemini_analyzer import CodeAnalyzer | ||
__all__ = [ | ||
'CodeAnalyzer' | ||
] | ||
|
||
__all__ = ["CodeAnalyzer"] |
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,28 +1,38 @@ | ||
import os | ||
import streamlit as st | ||
from typing_extensions import TypedDict | ||
|
||
|
||
class AnalyzerConfigs: | ||
''' | ||
""" | ||
This class contains configuration settings for the CodeAnalyzer class. | ||
''' | ||
""" | ||
|
||
gemini_models: list = [ | ||
# INFO : https://ai.google.dev/gemini-api/docs/json-mode?lang=python | ||
"gemini-1.5-flash", | ||
"gemini-1.5-pro", | ||
"gemini-1.5-pro", # INFO : https://ai.google.dev/gemini-api/docs/json-mode?lang=python | ||
] | ||
famous_languages: list = ["Python", "Java", "JavaScript", "C++", "C#", "Ruby", "Go", "Swift", "Rust"] | ||
genai_api_key: str = os.getenv("GENAI_API_KEY") | ||
famous_languages: list = [ | ||
"Python", | ||
"Java", | ||
"JavaScript", | ||
"C++", | ||
"C#", | ||
"Ruby", | ||
"Go", | ||
"Swift", | ||
"Rust", | ||
] | ||
genai_api_key: str = st.secrets["GENAI_API_KEY"] | ||
style_guides: dict = { | ||
'google_style': 'https://google.github.io/styleguide/pyguide.html', | ||
'pep8': 'https://pep8.org/', | ||
"google style": "https://google.github.io/styleguide/pyguide.html", | ||
"pep8": "https://pep8.org/", | ||
} | ||
|
||
|
||
class ResponseData(TypedDict): | ||
''' | ||
For schema based responses like `JSON` or `Dict` objects, used TypedDict to define the structure of the response. | ||
''' | ||
""" | ||
For schema based responses like `JSON` | ||
""" | ||
|
||
line: int | ||
message: str | ||
severity: str | ||
start_char: int | ||
end_char: int # Add this line to include the end_char in the response |
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,6 +1,7 @@ | ||
def greet(name): | ||
"""Greets the person with the given name.""" | ||
"""Greets the person with the given name.""" | ||
|
||
print("Hello,", name) | ||
|
||
print("Hello,", name) | ||
|
||
greet("Alice") |
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,6 +1,8 @@ | ||
def calculate_sum( a , b): # Intentional spacing issues | ||
def calculate_sum(a, b): # Intentional spacing issues | ||
"""This function calculates the sum of two numbers.""" | ||
result=a+b | ||
return result # Incorrect indentation | ||
result = a + b | ||
|
||
|
||
return result # Incorrect indentation | ||
|
||
print(calculate_sum(10, 5)) |
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