Skip to content

[HUST CSE][document] Fix some comments, invalid grouping commands and warnings in Doxygen. #7229

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

Merged
merged 7 commits into from
Apr 14, 2023

Conversation

BIIIANG
Copy link
Contributor

@BIIIANG BIIIANG commented Apr 12, 2023

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

#6857 ,很多文件中存在的Doxygen分组指令由于Doxygen的更新已经失效,且Doxygen配置没有跟随代码修改而修改,导致生成中存在警告、生成的文档有非常多空白页面。

你的解决方案是什么 (what is your solution)

  1. 将Doxygen输入文件(由Doxyfile中的INPUT定义)中的失效Doxygen分组指令(如/*@*//*@}*/)更改为有效的分组指令(如/**@*//**@}*/);(此处只对INPUT中的文件做了修改,bsp目录下和libcpu目录下存在近万个失效的Doxygen分组指令,但由于不作为文档的输入文件且这些文件过于庞大老旧,没有对这些文件中的无效指令做修改)
  2. 将图片文件统一放入了images目录下;
  3. 修改了Doxyfile和部分Doxygen注释,使得Doxyfile能够定位到新的代码路径且不受重复实现的影响;
  4. 解决了一些注释中的参数名不匹配、参数多余/缺失等问题。

具体每个commit对应的修改:

  1. [document] Fix some invalid Doxygen grouping commands:修改了components/dfs/dfs_v1/src./*.c、components/dfs/dfs_v2/src./*.c、documentation/doxygen/{kernel.h,hardware.h,systeminit.h}中的失效分组指令,并一并修改了documentation/doxygen下三个文件中的一些小typo以及注释中一个缺少的参数。
  2. [document] Move images to the new folder:将Doxygen用到的图片文件统一移动到了 [doxygen] Fix some warnings in doxygen #6899 创建的images文件夹下并修改了Doxyfile中的图片路径使得功能不变。
  3. [document] Fix some warnings in Doxygen.:这个commit是为了修复以下的警告:
warning: tag INPUT: input source '../../components/dfs/src' does not exist   => (1)
warning: tag INPUT: input source '../../components/dfs/include' does not exist   => (2)
warning: the dot tool could not be found as '../../tools/dot.exe'   => (3)
...
warning: source '../../components/dfs/src' is not a readable file or directory... skipping.   => (4)
warning: source '../../components/dfs/include' is not a readable file or directory... skipping.   => (5)
...
C:/Users/16141/Desktop/rt/rt-thread/src/scheduler_up.c:349: warning: argument 'thread' from the argument list of rt_schedule_insert_thread has multiple @param documentation sections   => (6)
C:/Users/16141/Desktop/rt/rt-thread/src/scheduler_up.c:401: warning: argument 'thread' from the argument list of rt_schedule_remove_thread has multiple @param documentation sections   => (7)
C:/Users/16141/Desktop/rt/rt-thread/documentation/doxygen/systeminit.h:65: warning: argument 'begin_addr' from the argument list of rt_system_heap_init has multiple @param documentation sections   => (8)
C:/Users/16141/Desktop/rt/rt-thread/documentation/doxygen/systeminit.h:65: warning: argument 'end_addr' from the argument list of rt_system_heap_init has multiple @param documentation sections   => (9)
...
*** Doxygen has finished
  • 其中(1)(2)(4)(5)是由于components/dfs的dfs分化成了两个版本dfs_v1和dfs_v2导致路径错误,这会导致dfs中的函数注释没有办法生成文档,最终的文档里的相应页面是空白的;我修改了Doxyfile里的INPUT参数,使路径指向了dfs_v2(我不清楚今后v1和v2是否还会合并,如果会的话到时候可能还需要改回来)。修改路径后由于dfs_posix.c中的注释格式有误又产生了新的警告,因此我又对{dfs_v1,dfs_v2}/src/dfs_posix.c中的注释参数名错误以及返回值多余做了修改。
  • (3)是缺少dot.exe,由于文档中关闭了其他使用dot的选项,这一警告没有实质影响,如果想消除这一警告只需要删除Doxyfile里的dot路径即可,由于没有实质影响我就没有更改。
  • (6)(7)是因为最近的提交里把scheduler.c分化成了scheduler_up.c和scheduler_mp.c两个文件,这两个文件将某些函数实现了两次并且向Doxygen添加了两次,这会导致产生这两个警告以及在生成的文档里这些函数的信息被重复两次,所以我参考了对其他多个实现的函数的处理方法,在doxygen文件夹下创建了thread.h文件,将scheduler_up.c和scheduler_mp.c的函数注释及声明放置在这个.h文件中,在这个.h文件的每个函数的注释的note部分注明了在scheduler_up.c和scheduler_mp.c是否有实现,通过这个.h文件提交给doxygen,并且将scheduler_up.c和scheduler_mp.c中向Doxygen提交函数的部分用cond指令关闭掉,从而能够生成正常的文档。
  • (8)(9)是因为systeminit.h中想要把rt_system_heap_init()加入到SystemInit这个组中,但是rt_system_heap_init()已经在他的实现的位置导入到Doxygen了,此处只想把他加入新的组不需要再把注释重复一遍,所以删除了注释部分只留下了ingroup指令。
  • 最后的一个更改是我在Doxyfile里开启了REPEAT_BRIEF和ALWAYS_DETAILED_SEC选项,因为我注意到如果不开启这两个选项,如果一个函数的注释只有brief部分,那么他在生成的文档里只在左侧有一个函数名的空索引,甚至找不到他的brief信息。为了能够展示每个被导入到Doxygen里的函数的信息并且使得索引有效,我开启了这两个选项。
  1. [document] Fix some format errors.:我注意到autocheck的format检查里提醒我存在一些行尾空格,我删除了这些多余的空格。
  2. [src] Fix some comments.:完善了src下几个文件里的注释,解决的问题包括参数缺失、返回值缺失、参数顺序错误、参数名错误。
  3. [src] Fix some comments.:是第五个commit遗漏的一处更改。

最初没想过这个PR会这么复杂,但是看的过程中发现要修改的地方有些越来越多,导致这个PR有些过于复杂。😣😣😣

以上的所有修改本质上都不会影响代码的正常运行,新创建的thread.h也与doxygen目录下的其他.h文件一样只用于生成文档,不参与任何的代码编译。

在什么测试环境下测试通过 (what is the test environment)

在Doxygen GUI 1.9.6(Windows)下测试,修复了除dot.exe不存在的其他所有警告,能够生成结构正确、内容充实的文档。

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

@CLAassistant
Copy link

CLAassistant commented Apr 12, 2023

CLA assistant check
All committers have signed the CLA.

@BIIIANG BIIIANG changed the title [HUST CSE] [document] Fix some invalid grouping commands and warnings in Doxygen. [HUST CSE][document] Fix some commends, invalid grouping commands and warnings in Doxygen. Apr 12, 2023
@BIIIANG BIIIANG marked this pull request as ready for review April 13, 2023 14:06
@BIIIANG BIIIANG changed the title [HUST CSE][document] Fix some commends, invalid grouping commands and warnings in Doxygen. [HUST CSE][document] Fix some comments, invalid grouping commands and warnings in Doxygen. Apr 13, 2023
@supperthomas
Copy link
Member

下次可以尝试慢慢修复,将任务切成一小份一小份的提交。每次PR 修复 一个功能。

@supperthomas
Copy link
Member

有生成好的html吗?压缩成zip上传看看。或者截图看下生成后的效果。

@supperthomas
Copy link
Member

documentation/doxygen/images/.gitkeep 这个文件,删了?

@supperthomas
Copy link
Member

还是非常感谢帮忙pr修复的

@BIIIANG
Copy link
Contributor Author

BIIIANG commented Apr 14, 2023

有生成好的html吗?压缩成zip上传看看。或者截图看下生成后的效果。

OK 我等下上传一下前后对比

@BIIIANG
Copy link
Contributor Author

BIIIANG commented Apr 14, 2023

html-before.zip
html-after.zip
解压缩之后打开html/index.html进入文档。

下面是几处比较大的更改:
diff-1
diff-2
diff-3
diff-4

@BIIIANG
Copy link
Contributor Author

BIIIANG commented Apr 14, 2023

documentation/doxygen/images/.gitkeep 这个文件,删了?

因为把图片移到了这个目录里,目录里不为空了,所以我就把.gitkeep删掉了,这会有什么副作用吗?

@supperthomas
Copy link
Member

supperthomas commented Apr 14, 2023

documentation/doxygen/images/.gitkeep 这个文件,删了?

因为把图片移到了这个目录里,目录里不为空了,所以我就把.gitkeep删掉了,这会有什么副作用吗?

没事,可以的。其他的修改提交下,即可。

@BIIIANG
Copy link
Contributor Author

BIIIANG commented Apr 14, 2023

documentation/doxygen/images/.gitkeep 这个文件,删了?

因为把图片移到了这个目录里,目录里不为空了,所以我就把.gitkeep删掉了,这会有什么副作用吗?

没事,可以的。其他的修改提交下,即可。

OK,已经按照Changes requested里的建议做了修改。

@supperthomas
Copy link
Member

documentation/doxygen/images/.gitkeep 这个文件,删了?

因为把图片移到了这个目录里,目录里不为空了,所以我就把.gitkeep删掉了,这会有什么副作用吗?

没事,可以的。其他的修改提交下,即可。

OK,已经按照Changes requested里的建议做了修改。

做的很棒👍🏻

@mysterywolf mysterywolf merged commit 2c98ce4 into RT-Thread:master Apr 14, 2023
@mysterywolf
Copy link
Member

感谢提交pr

@mysterywolf mysterywolf added the University: HUST IoTS&P Lab 华中科技大学网络空间安全学院 label Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
University: HUST IoTS&P Lab 华中科技大学网络空间安全学院
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants