Skip to content

Commit a069dfc

Browse files
committed
clean code
1 parent 993a302 commit a069dfc

3 files changed

Lines changed: 11 additions & 29 deletions

File tree

.github/workflows/deepseek_review.yml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,19 @@ name: Deepseek Code Review
22
on:
33
pull_request_target:
44
types:
5-
- opened # Triggers when a PR is opened
5+
- opened # Triggers when a PR is opened
66

7+
# fix: GraphQL: Resource not accessible by integration (addComment) error
78
permissions:
8-
contents: read
99
pull-requests: write
1010

1111
jobs:
1212
setup-deepseek-review:
13-
if: github.event_name == 'pull_request_target'
13+
timeout-minutes: 30
1414
runs-on: ubuntu-latest
1515
name: Code Review
1616
steps:
17-
- name: Checkout deepseek-review scripts
18-
uses: actions/checkout@v4
19-
with:
20-
repository: hustcer/deepseek-review
21-
path: .tmp/deepseek-review
22-
23-
- name: Setup Nu
24-
uses: hustcer/setup-nu@v3.23
25-
with:
26-
version: 0.112.2
27-
2817
- name: DeepSeek Code Review
29-
shell: nu {0}
30-
env:
31-
REVIEW_PR_NUMBER: ${{ github.event.pull_request.number }}
32-
REVIEW_REPO: ${{ github.repository }}
33-
REVIEW_TOKEN: ${{ secrets.DEEPSEEK_CHAT_TOKEN }}
34-
REVIEW_GITHUB_TOKEN: ${{ github.token }}
35-
REVIEW_MODEL: deepseek-v4-flash
36-
run: |
37-
const NU_LIB_DIRS = [ '${{ github.workspace }}/.tmp/deepseek-review/nu' ]
38-
use review.nu *
39-
40-
deepseek-review $env.REVIEW_TOKEN --model $env.REVIEW_MODEL --repo $env.REVIEW_REPO --pr-number $env.REVIEW_PR_NUMBER --gh-token $env.REVIEW_GITHUB_TOKEN
18+
uses: hustcer/deepseek-review@v1
19+
with:
20+
chat-token: ${{ secrets.DEEPSEEK_CHAT_TOKEN }}

crates/emmylua_doc_cli/src/html_generator/generators.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use emmylua_code_analysis::{
44
};
55
use emmylua_parser::VisibilityKind;
66

7-
use crate::html_generator::html_type;
7+
use crate::html_generator::html_type::{self, TypeLinker};
88
use crate::html_generator::types::{HtmlDoc, HtmlMember};
99
use crate::markdown_generator::generator::collect_property;
1010

@@ -16,7 +16,7 @@ pub struct GenContext<'a> {
1616
pub db: &'a DbIndex,
1717
/// Maps a type declaration id to a page href (prefixed relative to the
1818
/// page being generated).
19-
pub linker: &'a super::html_type::TypeLinker<'a>,
19+
pub linker: &'a TypeLinker<'a>,
2020
}
2121

2222
pub fn build_type_doc(ctx: &GenContext, typ: &LuaTypeDecl) -> Option<HtmlDoc> {

crates/emmylua_doc_cli/src/html_generator/types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use serde::Serialize;
22

3+
use crate::markdown_generator::markdown_types;
4+
35
use super::markdown::render_markdown;
46
use super::render::html_escape;
57

@@ -135,7 +137,7 @@ pub struct HtmlDoc {
135137
impl HtmlDoc {
136138
/// Stores rendered doc fields. Description / see / other are rendered as
137139
/// markdown HTML; deprecated is escaped plain text.
138-
pub fn set_property(&mut self, property: crate::markdown_generator::markdown_types::Property) {
140+
pub fn set_property(&mut self, property: markdown_types::Property) {
139141
self.description = property.description.map(|s| render_markdown(&s));
140142
self.deprecated = property.deprecated.map(|s| html_escape(&s));
141143
self.see = property.see.map(|s| render_markdown(&s));

0 commit comments

Comments
 (0)