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 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions .autocorrectrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# 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
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
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
Expand Up @@ -49,7 +49,7 @@ tags:

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

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

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

Expand Down Expand Up @@ -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
Expand Up @@ -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}

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

:::tip

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/luogu/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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}
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/luogu/problem/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sidebar_position: 4

## Special Judge 使用说明

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

详见:[Special Judge 使用说明](./special-judge.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/manual/luogu/problem/interactive-problems.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -21,7 +21,7 @@

### 基本运算

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

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

![team15](_image/team15.jpg)

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

![team16](_image/team16.jpg)

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


## 六、发票说明
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/academic/guide/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);//排序后取最大值。
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/academic/handbook/latex.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $\LaTeX$ 是一种基于 $\TeX$ 的排版系统,能够很方便的生成数学

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

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

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

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

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

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

**例如:**

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

```cpp
#include<iostream>
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/academic/lgr/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sidebar_position: 100

本文中的『月赛』均指大月赛或小月赛,而不指普及组月赛和语言月赛。

在联系 kkksc03 并与对接的月赛审核员[$^{\textsf{[2]}}$](https://www.luogu.com.cn/discuss/186291)联系后,您需要准备:
在联系 kkksc03 并与对接的月赛审核员[$^{\textsf{[2]}}$](https://www.luogu.com.cn/discuss/186291) 联系后,您需要准备:

1. 首先明确是大月赛还是小月赛,或其他类别。大月赛分 Div.2 和 Div.1,每个 Div 都是 $4$ 题,两个 Div 之间共享 $2$ 题,也就是有 ABCDEF 难度递增的共 $6$ 题,Div.2 含有 ABCD,Div.1 含有 CDEF。小月赛相当于只有大月赛的 Div.2。其他类别指的是题目编排上非传统,例如相同模型的题目分两个题或是两个 Div 均有的彩蛋题等等,但仍然需要与小月赛或大月赛中的其中一者类似,这是为了方便出题费用发放(大月赛 ¥4300 元,小月赛 ¥2200 元)。[$^{\textsf{[5]}}$](./payroll.md)
2. 原则上洛谷不接受多个组织或个人在无交流的情况下共同组题,即我们推荐在同一个组织内准备好所有题目后提交月赛申请,或至少有合作关系并且出题相关人员之间可以正常沟通。
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/academic/lgr/sponsoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(没有出题组冠字号,但有赞助商名称的月赛)

### 页面说明

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/academic/solution-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 等一类常用位运算实现集合运算的代码,建议在题解中用**集合语言**直接描述。以下是一个例子:

Expand Down
2 changes: 1 addition & 1 deletion docs/ula/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ tags:

2.11 **用户需自行配备符合上课环境要求的软硬件配套设施,如因用户网络及设备自身原因导致的课程无法正常进行,洛谷网校不承担任何责任。**

2.12 用户有权向洛谷网校要求注销用户的账户,经洛谷网校审核同意的,洛谷网校注销(永久冻结)用户的账户,届时,用户与洛谷网校基于本协议的合同关系即终止。用户的账户被注销(永久冻结)后,洛谷网校没有义务为用户保留或向用户披露用户账户中的任何信息,也没有义务向用户或第三方转发任何用户未曾阅读或发送过的信息。
2.12 用户有权向洛谷网校要求注销用户的账户,经洛谷网校审核同意的,洛谷网校注销(永久冻结) 用户的账户,届时,用户与洛谷网校基于本协议的合同关系即终止。用户的账户被注销(永久冻结)后,洛谷网校没有义务为用户保留或向用户披露用户账户中的任何信息,也没有义务向用户或第三方转发任何用户未曾阅读或发送过的信息。

2.13 未经洛谷网校同意,不得向其他用户或其他第三方转让、出借、许可使用、出售洛谷网校的全部或部分服务。

Expand Down
Loading
Loading