Skip to content

[action] add autocorrect to auto fix #106

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
135 changes: 135 additions & 0 deletions .autocorrectrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# yaml-language-server: $schema=https://huacnlee.github.io/autocorrect/schema.json
rules:
# Default rules: https://github.com/huacnlee/autocorrect/raw/main/autocorrect/.autocorrectrc.default
spellcheck: 2
# Enable or disable in special context
space-dash: 0
# Add space between brackets (), [] when near the CJK.
space-bracket: 0
# Add space between ``, when near the CJK.
space-backticks: 0
context:
# Enable or disable to format codeblock in Markdown or AsciiDoc etc.
codeblock: 1
textRules:
# Config some special rule for some texts
# For example, if we wants to let "Hello你好" just warning, and "Hi你好" to ignore
# "Hello你好": 2
# "Hi你好": 0
"沪ICP备18008322号": 0
"本题提交次数-1": 0
"众所周知,生存还是死亡,这是个问题": 0
"需要使用Dijkstra的堆优化算法": 0
"桂平路481号": 0
"15号楼6B3室": 0
"上海洛谷网络科技有限公司.": 0
fileTypes:
# Config the files associations, you config is higher priority than default.
# "rb": ruby
# "Rakefile": ruby
# "*.js": javascript
# ".mdx": markdown
spellcheck:
words:
# Please do not add a general English word (eg. apple, python) here.
# Users can add their special words to their .autocorrectrc file by their need.
- ActiveMQ
- AirPods
- Aliyun
- API
- App Store
- AppKit
- AppStore = App Store
- AWS
- CacheStorage
- CDN
- CentOS
- CloudFront
- CORS
- CPU
- DNS
- Elasticsearch
- ESLint
- Facebook
- GeForce
- GitHub
- Google
- GPU
- H5
- Hadoop
- HBase
- HDFS
- HKEX
- HTML
- HTTP
- HTTPS
- I10n
- I18n
- iMovie
- IndexedDB
- Intel
- iOS
- iPad
- iPadOS
- iPhone
- iTunes
- JavaScript
- jQuery
- JSON
- JWT
- Linux
- LocalStorage
- macOS
- Markdown
- Microsoft
- MongoDB
- Mozilla
- MVC
- MySQL
- Nasdaq
- Netflix
- NodeJS = Node.js
- NoSQL
- NVDIA
- NYSE
- OAuth
- Objective-C
- OLAP
- OSS
- P2P
- PaaS
- RabbitMQ
- Redis
- RESTful
- RSS
- RubyGem
- RubyGems
- SaaS
- Sass
- SDK
- Shopify
- SQL
- SQLite
- SQLServer
- SSL
- Tesla
- TikTok
- tvOS
- TypeScript
- Ubuntu
- UML
- URI
- URL
- VIM
- watchOS
- WebAssembly
- WebKit
- Webpack
- Wi-Fi
- Windows
- WWDC
- Xcode
- XML
- YAML
- YML
- YouTube
36 changes: 36 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

name: autofix.ci # needed to securely identify the workflow

on:
pull_request:
push:
branches:
- "*"
permissions:
contents: read

jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: install pnpm
with:
run_install: false

- name: install node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: install dependencies
run: pnpm install

- name: "Linting: autocorrect"
continue-on-error: true
run: pnpm autocorrect --fix

- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
4 changes: 2 additions & 2 deletions docs/manual/class/course-enroll.md
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ tags:

![已加入购物车](https://ipic.luogu.com.cn/09x7z.png)

返回选课界面继续选课,重复4-6步骤进行操作
返回选课界面继续选课,重复 4-6 步骤进行操作

### 7.选定全部要购买的课程之后,点击头像旁边的购物车进行结算 {#step-7}

@@ -118,6 +118,6 @@ tags:
> 账号:`8888 8885 9930 0884`
> 开户行:浙江网商银行股份有限公司(浙江-杭州-没有支行)
> 户名:上海洛谷网络科技有限公司
> 联行号: `3233 3100 0001`(注意这个不是账号,一般仅于开户行列表中找不到网商银行时使用)
> 联行号`3233 3100 0001`(注意这个不是账号,一般仅于开户行列表中找不到网商银行时使用)

如果您对网校报名还有任何疑问,可以[联系客服](https://class.luogu.com.cn/service)。
4 changes: 2 additions & 2 deletions docs/manual/class/faq.md
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ A:洛谷网校使用**洛谷账号**,若未注册洛谷账号,请按照图

## Q:赠品物流信息在哪里查询?{#logistics-info}

A:进入[个人中心](https://class.luogu.com.cn/me#history) 切换到【历史订单】找到相应的订单,订单中的物流信息显示的就是赠品的快递单号,如果为【N/A】 那就是暂未发出或者还没更新单号。
A:进入[个人中心](https://class.luogu.com.cn/me#history) 切换到【历史订单】找到相应的订单,订单中的物流信息显示的就是赠品的快递单号,如果为【N/A】那就是暂未发出或者还没更新单号。

## Q:报名后,课前需要提前准备什么吗?{#system-requirement}

@@ -36,7 +36,7 @@ A:

:::tip

请使用最新版的 Chrome浏览器浏览洛谷网校。建议您将[我的学习中心](https://class.luogu.com.cn/learn)或对应课程详情页加入浏览器的收藏夹内,以便快速进入上课页面。
请使用最新版的 Chrome 浏览器浏览洛谷网校。建议您将[我的学习中心](https://class.luogu.com.cn/learn)或对应课程详情页加入浏览器的收藏夹内,以便快速进入上课页面。

:::
A:洛谷网校的课时上课入口在相应课程包目录内,点击【去上课】即可进入学习界面。
2 changes: 1 addition & 1 deletion docs/manual/luogu/account/index.md
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ sidebar_position: 3

新用户的初始动态等级为 0,也就是灰色用户名。用户在洛谷中按照洛谷社区规则使用各项功能,会增加动态等级。如果长时间不使用洛谷或者有违规行为,可能会降级。除非用户有严重违规行为或者在长时间不使用洛谷且未进行实名认证的情况下,一旦用户达到蓝名,则不会掉到灰名。你可以在打卡之后在打卡结果中看到自己用户名的颜色。**在犇犇或者讨论中询问颜色名字和咕值相关的一些问题将被和谐。**

如果用户抄袭题解或非恶意比赛作弊,将降级至棕名及名字旁带有 Cheater 标签,每次查到持续 15 日,并且在 90 日内不得在任何比赛获得排名。 15 日后,变成灰名并清空所有 AC 记录。(即,变为 Unaccepted 100 分状态)。(注:**棕名用户是仅次于封号的最严厉警告,如果发生任何违反洛谷社区规则的事情,直接立刻封禁一年。**)
如果用户抄袭题解或非恶意比赛作弊,将降级至棕名及名字旁带有 Cheater 标签,每次查到持续 15 日,并且在 90 日内不得在任何比赛获得排名。15 日后,变成灰名并清空所有 AC 记录。(即,变为 Unaccepted 100 分状态)。(注:**棕名用户是仅次于封号的最严厉警告,如果发生任何违反洛谷社区规则的事情,直接立刻封禁一年。**)

动态等级影响洛谷内很多权限,例如创建比赛、团队、提交冷却时间、图床、下载数据等。灰名会有较多的限制。

2 changes: 1 addition & 1 deletion docs/manual/luogu/article.md
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ sidebar_label: 个人专栏文章功能

个人公开:仅在 *个人中心* 内公开展示。

个人隐藏:仅限作者自己查看,会显示在自己的 *个人中心* 内,但不会对访客显示。 访客无法通过 url 访问。
个人隐藏:仅限作者自己查看,会显示在自己的 *个人中心* 内,但不会对访客显示。访客无法通过 url 访问。

已删除:不显示在 *文章管理-回收站* 内,但会保留在数据库内。

2 changes: 1 addition & 1 deletion docs/manual/luogu/commercial-contest.md
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ sidebar_position: 114514
![首页帖子置顶](_image/cc-top-post.png)
- 洛谷部分页面右下方广告位
![右下方广告位](_image/cc-ad-block.png)
- 洛谷科技微信公众号(约1万关注者
- 洛谷科技微信公众号(约 1 万关注者
![洛谷科技微信公众号](_image/cc-wechat-post.png)

向注册用户发送短信(需要没有关闭推送的用户)
2 changes: 1 addition & 1 deletion docs/manual/luogu/contest.md
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ sidebar_position: 6

对于公开赛请务必按照 [公开赛审核要求](../../rules/academic/opencontest-standard.md) 上传比赛,否则比赛可能会被爆破或者被惩罚。

**恶意创建公开比赛属于II类违反,一次即可封号。**
**恶意创建公开比赛属于 II 类违反,一次即可封号。**

个人邀请赛和团队内部赛比较宽松,但不可以违反以下几点:

2 changes: 1 addition & 1 deletion docs/manual/luogu/faq.md
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ sidebar_position: 2
- Linux 中换行符是 `\n` 而 Windows 中是 `\r\n`(多一个字符),有些数据在 Windows 中生成,而在洛谷评测机 Linux 环境下评测。这种情况在字符串输入中非常常见。
- 评测系统运行在 Linux 下,可能由于使用了 Linux 的保留字而出现 CE,但在 Windows 下正常。
- Linux 对内存的访问控制更为严格,因此在 Windows 上可能正常运行的无效指针或数组下标访问越界,在评测系统上无法运行。
- 严重的内存泄露的问题很可能会引起系统的保护模块杀死你的进程。因此,凡是使用 `malloc`(或 `calloc`、`realloc`、`new`)分配而得的内存空间,请使用 `free`(或 `delete`)完全释放。
- 严重的内存泄露的问题很可能会引起系统的保护模块杀死你的进程。因此,凡是使用 `malloc`(或 `calloc`、`realloc`、`new`分配而得的内存空间,请使用 `free`(或 `delete`)完全释放。
- 数据可能真的有问题。但是,如果已有不止一个人通过了这道题,那最好不要怀疑是数据的锅。

## 如何创建题目? {#problem-create}
2 changes: 1 addition & 1 deletion docs/manual/luogu/problem/index.md
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ sidebar_position: 4

## Special Judge 使用说明

当一个题目可以接受多种正确答案,即有多组解的时候,题目就必须被 Special Judge。
当一个题目可以接受多种正确答案即有多组解的时候题目就必须被 Special Judge。
Special Judge 程序使用输入数据和一些其他信息来判答你程序的输出,并将判答结果返回。

详见:[Special Judge 使用说明](./special-judge.md)
6 changes: 3 additions & 3 deletions docs/manual/luogu/problem/interactive-problems.md
Original file line number Diff line number Diff line change
@@ -107,8 +107,8 @@ extern "C" int plus(int a, int b) {

- 特别需要注意的点

缓冲区问题。C/C++语言的输入输出函数均自带有一定的缓冲区,因此你输出的内容不一定能立刻被交互库/SPJ所读取。如果不在合适的时间清空缓冲区,很可能会造成两个程序互相等待对方输出的情况而 TLE。
缓冲区问题。C/C++ 语言的输入输出函数均自带有一定的缓冲区,因此你输出的内容不一定能立刻被交互库/SPJ 所读取。如果不在合适的时间清空缓冲区,很可能会造成两个程序互相等待对方输出的情况而 TLE。

每次输出完一定内容、希望对面的程序开始进行处理时,都必须手动清空缓冲区。在 C 语言中,可使用 `fflush(stdout)` 函数。在C++语言中,可使用 `std::cout << std::flush`;在使用 `std::endl` 输出一个换行时,C++语言也会自动清空缓冲区。
每次输出完一定内容、希望对面的程序开始进行处理时,都必须手动清空缓冲区。在 C 语言中,可使用 `fflush(stdout)` 函数。在 C++ 语言中,可使用 `std::cout << std::flush`;在使用 `std::endl` 输出一个换行时,C++ 语言也会自动清空缓冲区。

交互SPJ最好不要占用太多的 CPU 资源,因为它将与用户的程序在同一个核心上执行。最好在评测程序等待来自SPJ的输入,或者评测程序已经结束运行之后,再进行复杂的计算。
交互 SPJ 最好不要占用太多的 CPU 资源,因为它将与用户的程序在同一个核心上执行。最好在评测程序等待来自 SPJ 的输入,或者评测程序已经结束运行之后,再进行复杂的计算。
2 changes: 1 addition & 1 deletion docs/manual/luogu/problem/scoring-script.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@

### 基本运算

和 C 语言中一样,可执行加减乘除和取模五种基本运算,运算符优先级和C语言相同,可使用括号改变优先级。
和 C 语言中一样,可执行加减乘除和取模五种基本运算,运算符优先级和 C 语言相同,可使用括号改变优先级。

```cpp
@b = (2 + 3) * @a;
2 changes: 1 addition & 1 deletion docs/manual/luogu/team/index.md
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ sidebar_position: 4

![team15](_image/team15.jpg)

当然,还有其他别的比赛类别,例如团队公开赛,可以在洛谷上公开显示,需要经过洛谷管理员的审核。而团队邀请赛可以邀请团队外的成员在不加入团队的情况下参加比赛。 团队邀请赛可以使用固定邀请码或者是多个邀请码的方式来邀请其他人参加。
当然,还有其他别的比赛类别,例如团队公开赛,可以在洛谷上公开显示,需要经过洛谷管理员的审核。而团队邀请赛可以邀请团队外的成员在不加入团队的情况下参加比赛。团队邀请赛可以使用固定邀请码或者是多个邀请码的方式来邀请其他人参加。

![team16](_image/team16.jpg)

2 changes: 1 addition & 1 deletion docs/manual/luogu/team/premium.md
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@
> 账号:`8888 8885 9930 0884`
> 开户行:浙江网商银行股份有限公司(浙江-杭州-没有支行)
> 户名:上海洛谷网络科技有限公司
> 联行号: `3233 3100 0001`(注意这个不是账号,一般仅于开户行列表中找不到网商银行时使用)
> 联行号`3233 3100 0001`(注意这个不是账号,一般仅于开户行列表中找不到网商银行时使用)


## 六、发票说明
6 changes: 3 additions & 3 deletions docs/rules/academic/guide/solution.md
Original file line number Diff line number Diff line change
@@ -147,17 +147,17 @@ int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);//优化cin,cout,险些TLE
cout.tie(0);//优化 cin,cout,险些 TLE
/* 同前。 */
int a[100005],n;
cin>>n; // 输入礼物数。
/* 题目输入格式里已经把输入的每个数字的含义写的很清楚了。 */
for(int i=1;i<=n;i++)//代表n个礼物
for(int i=1;i<=n;i++)//代表 n 个礼物
/* 还能是几个礼物? */
{
cin>>a[i];//输入坐标。
/* 同前。 */
a[i]=min(a[i]-1,1000000-a[i]);//取最小值min
a[i]=min(a[i]-1,1000000-a[i]);//取最小值 min
/* 是当读者完全不知道 min 函数吗? */
}
sort(a+1,a+1+n);//排序后取最大值。
4 changes: 2 additions & 2 deletions docs/rules/academic/handbook/latex.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ $\LaTeX$ 是一种基于 $\TeX$ 的排版系统,能够很方便的生成数学

文本文本$x \cdot \sin(y)$文本文本

行间公式(**Math Blocks**,独立成行居中的公式) 前后两行分别使用 `$$ $$`(每行两个美元符号)定界,Markdown 代码可以跨行写,例如:
行间公式(**Math Blocks**,独立成行居中的公式)前后两行分别使用 `$$ $$`(每行两个美元符号)定界,Markdown 代码可以跨行写,例如:

```latex
$$
@@ -59,7 +59,7 @@ $$
\end{pmatrix}
$$

行内公式的 “大小”(例如分数的大小、巨运算符上下标的位置)会比行间公式小,可以通过 `\displaystyle` 和 `\textstyle` 来切换两类模式:
行内公式的“大小”(例如分数的大小、巨运算符上下标的位置)会比行间公式小,可以通过 `\displaystyle` 和 `\textstyle` 来切换两类模式:

对于行内公式,使用 `\displaystyle` 的效果:

2 changes: 1 addition & 1 deletion docs/rules/academic/handbook/markdown.md
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ Markdown 建立代码块的方法:将 \`\`\` 置于这段代码的首行和末

**例如:**

![C++代码示例](../_image/CppCode.png)
![C++ 代码示例](../_image/CppCode.png)

```cpp
#include<iostream>
2 changes: 1 addition & 1 deletion docs/rules/academic/lgr/contest-standard.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ sidebar_position: 10

请将待审核比赛的类别设置为“团队内部赛”。

请提交 [工单](https://www.luogu.com.cn/ticket) 进行审核,点击【新建工单】→【申请公开赛】→输入比赛 ID→输入申请信息,并且选择对应的比赛类型,并写明联系人的QQ号
请提交 [工单](https://www.luogu.com.cn/ticket) 进行审核,点击【新建工单】→【申请公开赛】→输入比赛 ID→输入申请信息,并且选择对应的比赛类型,并写明联系人的 QQ 号

请在工单详情中写明以下信息:

4 changes: 2 additions & 2 deletions docs/rules/academic/lgr/sponsoring.md
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@ sidebar_position: 80

赞助商可以冠名本场月赛。冠名后,洛谷月赛的名称由 LGR 场次号、出题组冠字号(如果有)、赞助商名号构成,例如:

- 【LGR-127】HydroOJ 12 月月赛 R1 / X Round 11 Div.2 (带有赞助商名称的大月赛)
- 【LGR-129】HydroOJ 12 月普及组月赛 R3 (没有出题组冠字号,但有赞助商名称的月赛)
- 【LGR-127】HydroOJ 12 月月赛 R1 / X Round 11 Div.2(带有赞助商名称的大月赛)
- 【LGR-129】HydroOJ 12 月普及组月赛 R3(没有出题组冠字号,但有赞助商名称的月赛)

### 页面说明

2 changes: 1 addition & 1 deletion docs/rules/academic/opencontest-standard.md
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ sidebar_label: 公开赛规范
### 申请 Rated

- 申请 Rated 对比赛工作人员的奖项认证有更高的要求。具体而言,要求负责人达到 7 级,各题出题人均达到 5 级,其他人员的要求不变。
- 若希望比赛 Rated,请在新建工单页面的比赛类型选择“Rated公开赛”。
- 若希望比赛 Rated,请在新建工单页面的比赛类型选择“Rated 公开赛”。
- **如果明显不够 Rated 质量却依然申请 Rated,将进行适当的惩罚。**

### 修改题目
2 changes: 1 addition & 1 deletion docs/rules/academic/solution-standard.md
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ $$a + b = c$$
- 赋值语句 `a = b;` 可以写作 $a \gets b$(`$a \gets b$`)或 $b \to a$(`$b \to a$`)。
- 判定语句应使用 $=, \ne, <, \le, >, \ge$(`$=, \ne, <, \le, >, \ge$`)与艾佛森括号($[P]$ 当 $P$ 为真时取值为 $1$,$P$ 为假时取值为 $0$)进行描述。
- 整除应使用 $\lfloor \frac{a}{b} \rfloor, \lfloor a / b \rfloor, \lfloor a \div b \rfloor$(`$\lfloor \frac{a}{b} \rfloor, \lfloor a / b \rfloor, \lfloor a \div b \rfloor$`),不应使用 $\frac{a}{b}$ 或 $a/b$ 直接表示整除。
- 取模应使用 $a \bmod b$(`$a \bmod b$`) 或 $a \equiv b \pmod p$(`$a \equiv b \pmod p$`)。
- 取模应使用 $a \bmod b$(`$a \bmod b$`)或 $a \equiv b \pmod p$(`$a \equiv b \pmod p$`)。
- 不应出现 $a.b$ 等结构体式的写法,如有需要可以使用上下标表示。
- 位运算应使用 $\operatorname{and}, \operatorname{or}, \operatorname{xor}$(`$\operatorname{and}, \operatorname{or}, \operatorname{xor}$`)。特别地,对于状态压缩 DP 等一类常用位运算实现集合运算的代码,建议在题解中用**集合语言**直接描述。以下是一个例子:

2 changes: 1 addition & 1 deletion docs/ula/luogu.md
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ tags:

2.2 洛谷对网站服务不承担任何责任,不保证服务一定会满足用户的使用要求,也不保证服务不会被中断,对服务的及时性、安全性、准确性也不作担保。

2.3 洛谷网在现有技术上维护网站的正常运行,增加、修改和删除各项功能,并努力提升和改进技术,尽量提升用户的体验。 如因系统维护或升级的需要而需暂停网络服务,洛谷将尽可能事先进行通告。
2.3 洛谷网在现有技术上维护网站的正常运行,增加、修改和删除各项功能,并努力提升和改进技术,尽量提升用户的体验。如因系统维护或升级的需要而需暂停网络服务,洛谷将尽可能事先进行通告。

2.4 如果用户使用洛谷的其他付费服务,则需要遵守对应服务的用户协议。

Loading