Skip to content

Commit 3e856b4

Browse files
authored
Merge branch 'doocs:main' into main
2 parents a8e9684 + 5be8a6f commit 3e856b4

File tree

1,395 files changed

+48297
-37100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,395 files changed

+48297
-37100
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
mkdocs build -f mkdocs-en.yml
7070
7171
- name: Deploy
72-
uses: peaceiris/actions-gh-pages@v3
72+
uses: peaceiris/actions-gh-pages@v4
7373
with:
7474
github_token: ${{ secrets.GITHUB_TOKEN }}
7575
publish_dir: ./site

.github/workflows/prettier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Run prettier
3030
run: |
3131
git config --global core.quotepath off
32-
changed_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" | grep -E '\.js$|\.ts$|\.php$|\.sql$|\.rs$|\.md$' || true)
32+
changed_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" | grep -E '\.js$|\.ts$|\.php$|\.sql$|\.md$' || true)
3333
if [ -n "$changed_files" ]; then
3434
echo "Running prettier on the changed files"
3535
echo "$changed_files" | xargs -d '\n' npx prettier --write

.husky/_/husky.sh

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +0,0 @@
1-
#!/usr/bin/env sh
2-
if [ -z "$husky_skip_init" ]; then
3-
debug () {
4-
if [ "$HUSKY_DEBUG" = "1" ]; then
5-
echo "husky (debug) - $1"
6-
fi
7-
}
8-
9-
readonly hook_name="$(basename -- "$0")"
10-
debug "starting $hook_name..."
11-
12-
if [ "$HUSKY" = "0" ]; then
13-
debug "HUSKY env variable is set to 0, skipping hook"
14-
exit 0
15-
fi
16-
17-
if [ -f ~/.huskyrc ]; then
18-
debug "sourcing ~/.huskyrc"
19-
. ~/.huskyrc
20-
fi
21-
22-
readonly husky_skip_init=1
23-
export husky_skip_init
24-
sh -e "$0" "$@"
25-
exitCode="$?"
26-
27-
if [ $exitCode != 0 ]; then
28-
echo "husky - $hook_name hook exited with code $exitCode (error)"
29-
fi
30-
31-
if [ $exitCode = 127 ]; then
32-
echo "husky - command not found in PATH=$PATH"
33-
fi
34-
35-
exit $exitCode
36-
fi

.husky/commit-msg

100755100644
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
npx --no -- commitlint --edit $1
1+
npx --no -- commitlint --edit $1

.husky/pre-commit

100755100644
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
npx lint-staged --allow-empty $1
1+
npx lint-staged --allow-empty $1

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"braceStyle": "1tbs",
1212
"endOfLine": "lf",
1313
"sqlKeywordCase": "upper",
14+
"sqlCanonicalSyntax": false,
1415
"overrides": [
1516
{
1617
"files": ["*.sql"],
1718
"options": { "parser": "mysql" }
1819
}
19-
]
20+
],
21+
"plugins": ["prettier-plugin-sql-cst", "@prettier/plugin-php"]
2022
}

basic/sorting/HeapSort/README.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,19 +207,13 @@ fn sink(nums: &mut Vec<i32>, mut i: usize, n: usize) {
207207
fn main() -> io::Result<()> {
208208
let mut s = String::new();
209209
io::stdin().read_line(&mut s)?;
210-
let s: Vec<usize> = s
211-
.split(' ')
212-
.map(|s| s.trim().parse().unwrap())
213-
.collect();
210+
let s: Vec<usize> = s.split(' ').map(|s| s.trim().parse().unwrap()).collect();
214211
// let n = s[0];
215212
let m = s[1];
216213

217214
let mut nums = String::new();
218215
io::stdin().read_line(&mut nums)?;
219-
let mut nums: Vec<i32> = nums
220-
.split(' ')
221-
.map(|s| s.trim().parse().unwrap())
222-
.collect();
216+
let mut nums: Vec<i32> = nums.split(' ').map(|s| s.trim().parse().unwrap()).collect();
223217

224218
heap_sort(&mut nums);
225219
for num in nums.iter().take(m) {
@@ -486,19 +480,13 @@ fn sink(nums: &mut Vec<i32>, mut i: usize, n: usize) {
486480
fn main() -> io::Result<()> {
487481
let mut s = String::new();
488482
io::stdin().read_line(&mut s)?;
489-
let s: Vec<usize> = s
490-
.split(' ')
491-
.map(|s| s.trim().parse().unwrap())
492-
.collect();
483+
let s: Vec<usize> = s.split(' ').map(|s| s.trim().parse().unwrap()).collect();
493484
// let n = s[0];
494485
let m = s[1];
495486

496487
let mut nums = String::new();
497488
io::stdin().read_line(&mut nums)?;
498-
let mut nums: Vec<i32> = nums
499-
.split(' ')
500-
.map(|s| s.trim().parse().unwrap())
501-
.collect();
489+
let mut nums: Vec<i32> = nums.split(' ').map(|s| s.trim().parse().unwrap()).collect();
502490

503491
heap_sort(&mut nums);
504492
for num in nums.iter().take(m) {

basic/sorting/HeapSort/Solution.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,13 @@ fn sink(nums: &mut Vec<i32>, mut i: usize, n: usize) {
3737
fn main() -> io::Result<()> {
3838
let mut s = String::new();
3939
io::stdin().read_line(&mut s)?;
40-
let s: Vec<usize> = s
41-
.split(' ')
42-
.map(|s| s.trim().parse().unwrap())
43-
.collect();
40+
let s: Vec<usize> = s.split(' ').map(|s| s.trim().parse().unwrap()).collect();
4441
// let n = s[0];
4542
let m = s[1];
4643

4744
let mut nums = String::new();
4845
io::stdin().read_line(&mut nums)?;
49-
let mut nums: Vec<i32> = nums
50-
.split(' ')
51-
.map(|s| s.trim().parse().unwrap())
52-
.collect();
46+
let mut nums: Vec<i32> = nums.split(' ').map(|s| s.trim().parse().unwrap()).collect();
5347

5448
heap_sort(&mut nums);
5549
for num in nums.iter().take(m) {

basic/sorting/MergeSort/Main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ fn main() -> io::Result<()> {
4343

4444
let mut nums = String::new();
4545
io::stdin().read_line(&mut nums)?;
46-
let mut nums: Vec<i32> = nums
47-
.split(' ')
48-
.map(|s| s.trim().parse().unwrap())
49-
.collect();
46+
let mut nums: Vec<i32> = nums.split(' ').map(|s| s.trim().parse().unwrap()).collect();
5047

5148
merge_sort(&mut nums, 0, n - 1);
5249
for num in nums.iter() {

basic/sorting/MergeSort/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,7 @@ fn main() -> io::Result<()> {
302302

303303
let mut nums = String::new();
304304
io::stdin().read_line(&mut nums)?;
305-
let mut nums: Vec<i32> = nums
306-
.split(' ')
307-
.map(|s| s.trim().parse().unwrap())
308-
.collect();
305+
let mut nums: Vec<i32> = nums.split(' ').map(|s| s.trim().parse().unwrap()).collect();
309306

310307
merge_sort(&mut nums, 0, n - 1);
311308
for num in nums.iter() {

0 commit comments

Comments
 (0)