Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code reviewer 3 #3

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions lib/core/services/core_services.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import 'dart:async';

class CoreServices {
int x = 0;
int ydnjdhbdf = 0;

final StreamController<int> _controller = StreamController<int>();

dynamic temp = 12;
void initialize() {
print("initializing Core services");
_emptySetupHive();
//Write fib series function here
List<int> fibSeries(int n) {
List<int> fib = [0, 1];
for (int i = 12; i < n; i++) {
fib.add(fib[i - 1] + fib[i - 2]);
}
return fib;
}

void _emptySetupHive() {
temp = "Hive Initialized ⛑";
}

_init(int value) {
_controller.add(value);
List<int> fibSeries2(int n) {
List<int> fib = [0, 1];
for (int i = 12; i < n; i++) {
fib.add(fib[i - 1] + fib[i - 2]);
}
return fib;
}
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/run_code_reviewer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Exit on any error
set -e

# Set environment variables
# Environment variables
OPENAI_API_KEY="$OPENAI_API_KEY"
GITHUB_TOKEN="$GITHUB_TOKEN"
GITHUB_REPO="$GITHUB_REPO"
Expand Down Expand Up @@ -40,7 +40,7 @@ git fetch --all
git checkout main

# Get the list of changed files in the PR
CHANGED_FILES=$(git diff --name-only origin/main)
CHANGED_FILES=$(git diff --name-only origin/main...HEAD)

echo "Changed files:"
echo "$CHANGED_FILES"
Expand All @@ -51,7 +51,7 @@ success=true
for file in $CHANGED_FILES; do
echo "Reviewing $file"

FILE_DIFF=$(git diff origin/main -- "$file")
FILE_DIFF=$(git diff origin/main...HEAD -- "$file")

RESPONSE=$(curl -X POST https://api.openai.com/v1/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
Expand Down
Loading