prreview 0.2.0 → 0.3.0
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.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/prreview/version.rb +1 -1
- data/lib/prreview.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af7fe1f1ccb8ef35c2eeec1252123861705106dc5439725923915ee20aa21fc6
|
4
|
+
data.tar.gz: 97c37aa978ee7df44aff01eaa890acc5bb2a60eacd17fceb7ad5cc4319f8aa1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 197d7fa53eda6c389cc68ff8eb97cb792e1704e4c808a74746bda25274194498a19b90cfbcd5b1dea89b5a7d7b16190790da198fba5571830ef902c0636e5b71
|
7
|
+
data.tar.gz: 680a13f38effb95f562898efd5b13baad3e6c16334ac2e37f783f4e8dec1ab4b86a3ada77a42b4cbe47c876340a946dd2c379361a36028ef5f2ac52d0bb28e7b
|
data/README.md
CHANGED
@@ -44,6 +44,7 @@ However, in the future we might add some optional integrations.
|
|
44
44
|
|
45
45
|
## Tips
|
46
46
|
|
47
|
+
- A well-written PR and linked issue description make a big difference — and are good practice anyway.
|
47
48
|
- Run `prreview` after you've thoroughly reviewed the PR. It works best when you understand the changes well.
|
48
49
|
- Don't hesitate to try different LLMs or refresh the response to see if something new comes up.
|
49
50
|
- Use `--all-content` and other extra options — they can significantly improve results for some PRs.
|
data/lib/prreview/version.rb
CHANGED
data/lib/prreview.rb
CHANGED
@@ -49,7 +49,7 @@ module Prreview
|
|
49
49
|
@prompt = DEFAULT_PROMPT
|
50
50
|
@include_content = false
|
51
51
|
@issues_limit = DEFAULT_ISSUES_LIMIT
|
52
|
-
@optional_files
|
52
|
+
@optional_files = []
|
53
53
|
|
54
54
|
parser = OptionParser.new do |opts|
|
55
55
|
opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} -u URL [options]"
|
@@ -110,7 +110,8 @@ module Prreview
|
|
110
110
|
puts "Fetching file content for #{path}"
|
111
111
|
|
112
112
|
content = @client.contents(@full_repo, path:, ref: @pull_request.head.sha)
|
113
|
-
Base64.decode64(content[:content])
|
113
|
+
decoded = Base64.decode64(content[:content])
|
114
|
+
binary?(decoded) ? '(binary file)' : decoded
|
114
115
|
rescue Octokit::NotFound
|
115
116
|
'(file content not found)'
|
116
117
|
end
|
@@ -194,6 +195,7 @@ module Prreview
|
|
194
195
|
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |x|
|
195
196
|
x.prompt do
|
196
197
|
x.task @prompt
|
198
|
+
x.current_date DateTime.now
|
197
199
|
|
198
200
|
x.pull_request do
|
199
201
|
x.number @pr_number
|
@@ -241,6 +243,10 @@ module Prreview
|
|
241
243
|
@xml = builder.doc.root.to_xml
|
242
244
|
end
|
243
245
|
|
246
|
+
def binary?(string)
|
247
|
+
string.include?("\x00")
|
248
|
+
end
|
249
|
+
|
244
250
|
def copy_result_to_clipboard
|
245
251
|
Clipboard.copy(@xml)
|
246
252
|
puts 'XML prompt generated and copied to clipboard.'
|