@parvez3019/gemini-review-code 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,14 @@
1
- # @hataiit9x/gemini-review-code
1
+ # @parvez3019/gemini-review-code
2
+
3
+ Based on - https://github.com/hataiit9x/gemini-review-code
2
4
 
3
- [![npm version](https://badge.fury.io/js/%40hataiit9x%2Freview-code-ai.svg)](https://badge.fury.io/js/%40hataiit9x%2Freview-code-ai)
4
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
6
 
6
7
  ## Summary
7
8
 
8
9
  ![](preview.png)
9
10
 
10
- `@hataiit9x/gemini-review-code` It is a small tool used for code review in GitLab Merge Requests. It supports calling the GitLab API for private
11
+ `@parvez3019/gemini-review-code` It is a small tool used for code review in GitLab Merge Requests. It supports calling the GitLab API for private
11
12
  deployment and uses the Gemini AI API to obtain review results. Please note that when using it, ensure compliance with company regulations. 😉
12
13
 
13
14
 
@@ -26,7 +27,7 @@ deployment and uses the Gemini AI API to obtain review results. Please note that
26
27
  ## Install
27
28
 
28
29
  ```sh
29
- npm i @hataiit9x/gemini-review-code
30
+ npm i @parvez3019/gemini-review-code
30
31
  `````
31
32
 
32
33
  ## Use
@@ -63,7 +64,7 @@ Code Review:
63
64
  stage: merge-request
64
65
  image: node:16
65
66
  script:
66
- - npm i @hataiit9x/gemini-review-code -g
67
+ - npm i @parvez3019/gemini-review-code -g
67
68
  - gemini-review-code -t "$GITLAB_TOKEN" -a "$API_KEY" -c "$CUSTOM_MODELS" -p "$CI_MERGE_REQUEST_PROJECT_ID" -m "$CI_MERGE_REQUEST_IID"
68
69
  only:
69
70
  - merge_requests
package/lib/utils.js CHANGED
@@ -1,13 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLineObj = exports.getDiffBlocks = exports.delay = exports.geminiCompletionsConfig = exports.geminiSuggestContent = exports.geminiSystemContent = void 0;
4
- exports.geminiSystemContent = "You are a code reviewer,Your role is to identify bugs, performance issues, and areas for optimization in the submitted code. You are also responsible for providing constructive feedback and suggesting best practices to improve the overall quality of the code. ";
4
+ exports.geminiSystemContent = "You are a senior software engineer and an expert code reviewer. " +
5
+ "You provide detailed, constructive, and actionable feedback to help developers write clean, " +
6
+ "efficient, secure, and maintainable code. You strictly follow industry best practices, " +
7
+ "language-specific style guides, and architecture principles. You point out bugs, " +
8
+ "performance issues, code smells, security concerns, and violations of SOLID principles. " +
9
+ "You offer specific suggestions for improvement and rewrite snippets when needed. " +
10
+ "Your tone is respectful, collaborative, and helpful—focused on mentoring and guiding.";
5
11
  exports.geminiSuggestContent = "Next, I will send you each step of the merge request in standard git diff format, your task is:\n" +
6
12
  " - Review the code changes (diffs) in the patch and provide feedback.\n" +
7
- " - Examine it carefully to see if it really has bugs or needs room for optimization, highlight them. \n" +
8
- " - Do not highlight minor issues and nitpicks.\n" +
13
+ " - Examine it carefully to see if it really has code quality issues, bugs or needs room for optimization, highlight them. \n" +
9
14
  " - Use bullet points if you have multiple comments.\n" +
10
15
  " - You don't have to explain what the code does\n" +
16
+ " - Follow the system prompt carefully\n" +
17
+ " - Make small small suggestions for improvement\n" +
11
18
  " Here are the changes that were committed this time";
12
19
  exports.geminiCompletionsConfig = {
13
20
  temperature: 1,
package/lib/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACa,QAAA,mBAAmB,GAAG,uQAAuQ,CAAA;AAE7R,QAAA,oBAAoB,GAAG,mGAAmG;IACnI,gGAAgG;IAChG,gIAAgI;IAChI,yEAAyE;IACzE,8EAA8E;IAC9E,0EAA0E;IAC1E,4EAA4E,CAAA;AAGnE,QAAA,uBAAuB,GAAG;IACnC,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,IAAI;IACV,IAAI,EAAE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