Skip to content

Commit e37f671

Browse files
authored
Use sophisticated pre-commit for validation (#1071)
* Switch to pre-commit * Update GitHub workflows * Add more sophisticated pre-commit hooks * Run pre-commits for the first time
1 parent 76f4d97 commit e37f671

401 files changed

Lines changed: 11304 additions & 11389 deletions

File tree

Some content is hidden

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

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# These are supported funding model platforms
2-
32
github: ccfddl

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ PR Title Format: Update conf_name conf_year
99

1010
### Related URL
1111
<!-- List useful URLs for reviewers to check -->
12-
-
12+
-

.github/workflows/deploy.yml

Lines changed: 53 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,60 @@
11
name: Deploy
2-
32
on:
43
push:
5-
branches: [ main ]
6-
4+
branches: [main]
75
jobs:
86
build:
97
runs-on: ubuntu-latest
10-
118
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2.3.4
14-
- name: Setup Node.js environment
15-
uses: actions/setup-node@main
16-
with:
17-
node-version: '15.x'
18-
- name: Set up Python 3.9
19-
uses: actions/setup-python@v1
20-
with:
21-
python-version: 3.9
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
python -m pip install PyYAML jsonschema icalendar xlin
26-
- name: Validate yml files
27-
run: |
28-
python ./scripts/validate
29-
- name: Assemble yml files
30-
run: |
31-
mkdir -p public/conference && cd public/conference
32-
awk 1 `find ../../conference -name '*.yml' -not -path '**/types.yml'` > allconf.yml
33-
awk 1 `find ../../accept_rates -name '*.yml'` > allacc.yml
34-
cp ../../conference/types.yml .
35-
cd ../..
36-
- name: Generate iCal files
37-
run: |
38-
python cli/ccfddl/convert_to_ical.py
39-
mv *.ics public/conference/
40-
- name: Get yarn cache directory path
41-
id: yarn-cache-dir-path
42-
run: echo "::set-output name=dir::$(yarn cache dir)"
43-
- uses: actions/cache@v4
44-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
45-
with:
46-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
47-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-yarn-
50-
- name: Install dependency and build
51-
run: |
52-
yarn config set strict-ssl false
53-
yarn install
54-
yarn build
55-
- name: Config Git
56-
run: |
57-
git config --global user.email "me@4f5da2.com"
58-
git config --global user.name "0x4f5da2"
59-
- name: Deploy
60-
run: |
61-
cd dist
62-
echo 'ccfddl.com' > CNAME
63-
git init
64-
git add --all
65-
git commit -m "Site Update:`TZ=':Asia/Shanghai' date +' %Y-%m-%d %H:%m:%S'`"
66-
git push --force https://${{ secrets.ACCESS_TOKEN }}@github.com/ccfddl/ccfddl.github.io.git master:page
9+
- name: Checkout
10+
uses: actions/checkout@v2.3.4
11+
- name: Setup Node.js environment
12+
uses: actions/setup-node@main
13+
with:
14+
node-version: '15.x'
15+
- name: Set up Python 3.9
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.9
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
python -m pip install PyYAML jsonschema icalendar xlin
23+
- name: Assemble yml files
24+
run: |
25+
mkdir -p public/conference && cd public/conference
26+
awk 1 `find ../../conference -name '*.yml' -not -path '**/types.yml'` > allconf.yml
27+
awk 1 `find ../../accept_rates -name '*.yml'` > allacc.yml
28+
cp ../../conference/types.yml .
29+
cd ../..
30+
- name: Generate iCal files
31+
run: |
32+
python cli/ccfddl/convert_to_ical.py
33+
mv *.ics public/conference/
34+
- name: Get yarn cache directory path
35+
id: yarn-cache-dir-path
36+
run: echo "::set-output name=dir::$(yarn cache dir)"
37+
- uses: actions/cache@v4
38+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
39+
with:
40+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
41+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-yarn-
44+
- name: Install dependency and build
45+
run: |
46+
yarn config set strict-ssl false
47+
yarn install
48+
yarn build
49+
- name: Config Git
50+
run: |
51+
git config --global user.email "me@4f5da2.com"
52+
git config --global user.name "0x4f5da2"
53+
- name: Deploy
54+
run: |
55+
cd dist
56+
echo 'ccfddl.com' > CNAME
57+
git init
58+
git add --all
59+
git commit -m "Site Update:`TZ=':Asia/Shanghai' date +' %Y-%m-%d %H:%m:%S'`"
60+
git push --force https://${{ secrets.ACCESS_TOKEN }}@github.com/ccfddl/ccfddl.github.io.git master:page

.github/workflows/merge_check.yml

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,43 @@
11
name: MergeCheck
2-
32
on:
43
pull_request:
5-
branches: [ main ]
6-
4+
branches: [main]
75
jobs:
86
build:
97
runs-on: ubuntu-latest
10-
118
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2.3.4
14-
- name: Setup Node.js environment
15-
uses: actions/setup-node@main
16-
with:
17-
node-version: '15.x'
18-
- name: Set up Python 3.9
19-
uses: actions/setup-python@v1
20-
with:
21-
python-version: 3.9
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
python -m pip install PyYAML jsonschema
26-
- name: Validate yml files
27-
run: |
28-
python ./scripts/validate
29-
- name: Assemble yml files
30-
run: |
31-
mkdir -p public/conference && cd public/conference
32-
cat `find ../../conference -name '*.yml' -not -path '**/types.yml'` > allconf.yml
33-
cp ../../conference/types.yml .
34-
cd ../..
35-
- name: Get yarn cache directory path
36-
id: yarn-cache-dir-path
37-
run: echo "::set-output name=dir::$(yarn cache dir)"
38-
- uses: actions/cache@v4
39-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
40-
with:
41-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
42-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
43-
restore-keys: |
44-
${{ runner.os }}-yarn-
45-
- name: Install dependency and build
46-
run: |
47-
yarn config set strict-ssl false
48-
yarn install
49-
yarn build
50-
9+
- name: Checkout
10+
uses: actions/checkout@v2.3.4
11+
- name: Setup Node.js environment
12+
uses: actions/setup-node@main
13+
with:
14+
node-version: '15.x'
15+
- name: Set up Python 3.9
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.9
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
python -m pip install PyYAML jsonschema
23+
- name: Assemble yml files
24+
run: |
25+
mkdir -p public/conference && cd public/conference
26+
cat `find ../../conference -name '*.yml' -not -path '**/types.yml'` > allconf.yml
27+
cp ../../conference/types.yml .
28+
cd ../..
29+
- name: Get yarn cache directory path
30+
id: yarn-cache-dir-path
31+
run: echo "::set-output name=dir::$(yarn cache dir)"
32+
- uses: actions/cache@v4
33+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
34+
with:
35+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
36+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-yarn-
39+
- name: Install dependency and build
40+
run: |
41+
yarn config set strict-ssl false
42+
yarn install
43+
yarn build

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: pre-commit
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
jobs:
7+
pre-commit:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
12+
- uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-case-conflict
6+
- id: check-merge-conflict
7+
- id: check-yaml
8+
- id: end-of-file-fixer
9+
- id: fix-byte-order-marker
10+
- id: mixed-line-ending
11+
args: [--fix=lf]
12+
- id: trailing-whitespace
13+
- repo: local
14+
hooks:
15+
- id: validate
16+
name: Validate Conference yaml files
17+
entry: python scripts/validate.py
18+
language: python
19+
additional_dependencies: [PyYAML, jsonschema]
20+
types: [python]
21+
- repo: https://github.com/google/yamlfmt
22+
rev: v0.17.2
23+
hooks:
24+
- id: yamlfmt
25+
name: Format YAML files
26+
- repo: https://github.com/python-jsonschema/check-jsonschema
27+
rev: 0.33.1
28+
hooks:
29+
- id: check-github-workflows
30+
name: Check GitHub Workflow configuration

.readme_assets/best-practice.drawio

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@
8383
</root>
8484
</mxGraphModel>
8585
</diagram>
86-
</mxfile>
86+
</mxfile>

accept_rates/AI/aaai.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- title: AAAI
22
accept_rates:
3-
- year: 2024
4-
submitted: 9862
5-
accepted: 2342
6-
str: 23.7%(2342/9862 24')
7-
rate: 0.237477185155141
8-
source: https://github.com/lixin4ever/Conference-Acceptance-Rate
3+
- year: 2024
4+
submitted: 9862
5+
accepted: 2342
6+
str: 23.7%(2342/9862 24')
7+
rate: 0.237477185155141
8+
source: https://github.com/lixin4ever/Conference-Acceptance-Rate

accept_rates/AI/acl.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
- title: ACL
22
accept_rates:
3-
- year: 2023
4-
submitted: 3872
5-
accepted: 910
6-
str: 23.5%(910/3872 23')
7-
rate: 0.235020661157025
8-
source: https://github.com/lixin4ever/Conference-Acceptance-Rate
9-
- year: 2024
10-
submitted: 4407
11-
accepted: 943
12-
str: 21.4%(943/4407 24')
13-
rate: 0.2139778
14-
source: https://csconfstats.xoveexu.com/
3+
- year: 2023
4+
submitted: 3872
5+
accepted: 910
6+
str: 23.5%(910/3872 23')
7+
rate: 0.235020661157025
8+
source: https://github.com/lixin4ever/Conference-Acceptance-Rate
9+
- year: 2024
10+
submitted: 4407
11+
accepted: 943
12+
str: 21.4%(943/4407 24')
13+
rate: 0.2139778
14+
source: https://csconfstats.xoveexu.com/

accept_rates/AI/acml.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- title: ACML
22
accept_rates:
3-
- year: 2024
4-
submitted: 353
5-
accepted: 92
6-
str: 26.1%(92/353 24')
7-
rate: 0.260623229
8-
source: https://www.acml-conf.org/
3+
- year: 2024
4+
submitted: 353
5+
accepted: 92
6+
str: 26.1%(92/353 24')
7+
rate: 0.260623229
8+
source: https://www.acml-conf.org/

0 commit comments

Comments
 (0)