neon_arch commited on
Commit
8dd18eb
1 Parent(s): 662cbcf

chore: add pre-commit checks for writting better code

Browse files
Files changed (5) hide show
  1. .gitignore +4 -2
  2. .rusty-hook.toml +5 -0
  3. .stylelintrc.json +13 -0
  4. Cargo.lock +62 -9
  5. Cargo.toml +4 -1
.gitignore CHANGED
@@ -1,3 +1,5 @@
1
  /target
2
-
3
- dump.rdb
 
 
 
1
  /target
2
+ package.json
3
+ package-lock.json
4
+ dump.rdb
5
+ .vscode
.rusty-hook.toml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ [hooks]
2
+ pre-commit = "cargo test && cargo fmt -- --check && cargo clippy && stylelint ./public/static/themes/*.css ./public/static/colorschemes/*.css ./public/static/*.js"
3
+
4
+ [logging]
5
+ verbose = true
.stylelintrc.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "extends": "stylelint-config-standard",
3
+ "rules": {
4
+ "alpha-value-notation": "number",
5
+ "selector-class-pattern": null
6
+ },
7
+ "overrides": [
8
+ {
9
+ "files": ["*.js"],
10
+ "customSyntax": "postcss-lit"
11
+ }
12
+ ]
13
+ }
Cargo.lock CHANGED
@@ -125,7 +125,7 @@ dependencies = [
125
  "actix-utils",
126
  "futures-core",
127
  "futures-util",
128
- "mio 0.8.7",
129
  "num_cpus",
130
  "socket2",
131
  "tokio 1.28.2",
@@ -438,6 +438,15 @@ version = "1.0.0"
438
  source = "registry+https://github.com/rust-lang/crates.io-index"
439
  checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
440
 
 
 
 
 
 
 
 
 
 
441
  [[package]]
442
  name = "cloudabi"
443
  version = "0.0.3"
@@ -693,6 +702,16 @@ dependencies = [
693
  "termcolor",
694
  ]
695
 
 
 
 
 
 
 
 
 
 
 
696
  [[package]]
697
  name = "errno"
698
  version = "0.3.1"
@@ -796,6 +815,12 @@ dependencies = [
796
  "percent-encoding 2.2.0",
797
  ]
798
 
 
 
 
 
 
 
799
  [[package]]
800
  name = "fuchsia-cprng"
801
  version = "0.1.1"
@@ -1510,9 +1535,9 @@ dependencies = [
1510
 
1511
  [[package]]
1512
  name = "mio"
1513
- version = "0.8.7"
1514
  source = "registry+https://github.com/rust-lang/crates.io-index"
1515
- checksum = "eebffdb73fe72e917997fad08bdbf31ac50b0fa91cec93e69a0662e4264d454c"
1516
  dependencies = [
1517
  "libc",
1518
  "log",
@@ -1567,6 +1592,12 @@ version = "1.0.4"
1567
  source = "registry+https://github.com/rust-lang/crates.io-index"
1568
  checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
1569
 
 
 
 
 
 
 
1570
  [[package]]
1571
  name = "nodrop"
1572
  version = "0.1.14"
@@ -1609,9 +1640,9 @@ checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b"
1609
 
1610
  [[package]]
1611
  name = "openssl"
1612
- version = "0.10.52"
1613
  source = "registry+https://github.com/rust-lang/crates.io-index"
1614
- checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56"
1615
  dependencies = [
1616
  "bitflags",
1617
  "cfg-if 1.0.0",
@@ -1641,9 +1672,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
1641
 
1642
  [[package]]
1643
  name = "openssl-sys"
1644
- version = "0.9.87"
1645
  source = "registry+https://github.com/rust-lang/crates.io-index"
1646
- checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e"
1647
  dependencies = [
1648
  "cc",
1649
  "libc",
@@ -2358,6 +2389,18 @@ dependencies = [
2358
  "windows-sys 0.48.0",
2359
  ]
2360
 
 
 
 
 
 
 
 
 
 
 
 
 
2361
  [[package]]
2362
  name = "ryu"
2363
  version = "1.0.13"
@@ -2879,7 +2922,7 @@ dependencies = [
2879
  "autocfg 1.1.0",
2880
  "bytes 1.4.0",
2881
  "libc",
2882
- "mio 0.8.7",
2883
  "num_cpus",
2884
  "parking_lot 0.12.1",
2885
  "pin-project-lite",
@@ -3038,6 +3081,15 @@ dependencies = [
3038
  "tracing",
3039
  ]
3040
 
 
 
 
 
 
 
 
 
 
3041
  [[package]]
3042
  name = "tower-service"
3043
  version = "0.3.2"
@@ -3316,7 +3368,7 @@ dependencies = [
3316
 
3317
  [[package]]
3318
  name = "websurfx"
3319
- version = "0.11.0"
3320
  dependencies = [
3321
  "actix-files",
3322
  "actix-web",
@@ -3330,6 +3382,7 @@ dependencies = [
3330
  "redis",
3331
  "reqwest 0.11.18",
3332
  "rlua",
 
3333
  "scraper",
3334
  "serde",
3335
  "serde_json",
 
125
  "actix-utils",
126
  "futures-core",
127
  "futures-util",
128
+ "mio 0.8.8",
129
  "num_cpus",
130
  "socket2",
131
  "tokio 1.28.2",
 
438
  source = "registry+https://github.com/rust-lang/crates.io-index"
439
  checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
440
 
441
+ [[package]]
442
+ name = "ci_info"
443
+ version = "0.10.2"
444
+ source = "registry+https://github.com/rust-lang/crates.io-index"
445
+ checksum = "24f638c70e8c5753795cc9a8c07c44da91554a09e4cf11a7326e8161b0a3c45e"
446
+ dependencies = [
447
+ "envmnt",
448
+ ]
449
+
450
  [[package]]
451
  name = "cloudabi"
452
  version = "0.0.3"
 
702
  "termcolor",
703
  ]
704
 
705
+ [[package]]
706
+ name = "envmnt"
707
+ version = "0.8.4"
708
+ source = "registry+https://github.com/rust-lang/crates.io-index"
709
+ checksum = "a2d328fc287c61314c4a61af7cfdcbd7e678e39778488c7cb13ec133ce0f4059"
710
+ dependencies = [
711
+ "fsio",
712
+ "indexmap",
713
+ ]
714
+
715
  [[package]]
716
  name = "errno"
717
  version = "0.3.1"
 
815
  "percent-encoding 2.2.0",
816
  ]
817
 
818
+ [[package]]
819
+ name = "fsio"
820
+ version = "0.1.3"
821
+ source = "registry+https://github.com/rust-lang/crates.io-index"
822
+ checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3"
823
+
824
  [[package]]
825
  name = "fuchsia-cprng"
826
  version = "0.1.1"
 
1535
 
1536
  [[package]]
1537
  name = "mio"
1538
+ version = "0.8.8"
1539
  source = "registry+https://github.com/rust-lang/crates.io-index"
1540
+ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
1541
  dependencies = [
1542
  "libc",
1543
  "log",
 
1592
  source = "registry+https://github.com/rust-lang/crates.io-index"
1593
  checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
1594
 
1595
+ [[package]]
1596
+ name = "nias"
1597
+ version = "0.5.0"
1598
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1599
+ checksum = "ab250442c86f1850815b5d268639dff018c0627022bc1940eb2d642ca1ce12f0"
1600
+
1601
  [[package]]
1602
  name = "nodrop"
1603
  version = "0.1.14"
 
1640
 
1641
  [[package]]
1642
  name = "openssl"
1643
+ version = "0.10.53"
1644
  source = "registry+https://github.com/rust-lang/crates.io-index"
1645
+ checksum = "12df40a956736488b7b44fe79fe12d4f245bb5b3f5a1f6095e499760015be392"
1646
  dependencies = [
1647
  "bitflags",
1648
  "cfg-if 1.0.0",
 
1672
 
1673
  [[package]]
1674
  name = "openssl-sys"
1675
+ version = "0.9.88"
1676
  source = "registry+https://github.com/rust-lang/crates.io-index"
1677
+ checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617"
1678
  dependencies = [
1679
  "cc",
1680
  "libc",
 
2389
  "windows-sys 0.48.0",
2390
  ]
2391
 
2392
+ [[package]]
2393
+ name = "rusty-hook"
2394
+ version = "0.11.2"
2395
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2396
+ checksum = "96cee9be61be7e1cbadd851e58ed7449c29c620f00b23df937cb9cbc04ac21a3"
2397
+ dependencies = [
2398
+ "ci_info",
2399
+ "getopts",
2400
+ "nias",
2401
+ "toml",
2402
+ ]
2403
+
2404
  [[package]]
2405
  name = "ryu"
2406
  version = "1.0.13"
 
2922
  "autocfg 1.1.0",
2923
  "bytes 1.4.0",
2924
  "libc",
2925
+ "mio 0.8.8",
2926
  "num_cpus",
2927
  "parking_lot 0.12.1",
2928
  "pin-project-lite",
 
3081
  "tracing",
3082
  ]
3083
 
3084
+ [[package]]
3085
+ name = "toml"
3086
+ version = "0.5.11"
3087
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3088
+ checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
3089
+ dependencies = [
3090
+ "serde",
3091
+ ]
3092
+
3093
  [[package]]
3094
  name = "tower-service"
3095
  version = "0.3.2"
 
3368
 
3369
  [[package]]
3370
  name = "websurfx"
3371
+ version = "0.12.0"
3372
  dependencies = [
3373
  "actix-files",
3374
  "actix-web",
 
3382
  "redis",
3383
  "reqwest 0.11.18",
3384
  "rlua",
3385
+ "rusty-hook",
3386
  "scraper",
3387
  "serde",
3388
  "serde_json",
Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
  [package]
2
  name = "websurfx"
3
- version = "0.11.0"
4
  edition = "2021"
5
 
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -22,3 +22,6 @@ redis = {version="*"}
22
  md5 = {version="*"}
23
  rand={version="*"}
24
  once_cell = {version="*"}
 
 
 
 
1
  [package]
2
  name = "websurfx"
3
+ version = "0.12.0"
4
  edition = "2021"
5
 
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
22
  md5 = {version="*"}
23
  rand={version="*"}
24
  once_cell = {version="*"}
25
+
26
+ [dev-dependencies]
27
+ rusty-hook = "^0.11.2"