aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-03-04 13:52:23 -0600
committerCody <cody@codyq.dev>2023-03-04 13:52:23 -0600
commitffd893f7c88769dfcb889861cf662b18f896a55f (patch)
tree46097a5c3b6987c24e04574b5b3541674624ba2c
parentd1593cfaf31f291cea63ed552d492138efa451ce (diff)
downloadsloth-ffd893f7c88769dfcb889861cf662b18f896a55f.tar.gz
Add GitHub workflow and update Nix flakes
-rw-r--r--.github/CODEOWNERS1
-rw-r--r--.github/workflows/linting.yml33
-rw-r--r--.github/workflows/testing.yml22
-rw-r--r--deny.toml7
-rw-r--r--flake.lock24
-rw-r--r--src/lexer.rs2
6 files changed, 70 insertions, 19 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..69085a7
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @CatDevz @nic-gaffney \ No newline at end of file
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
new file mode 100644
index 0000000..685b93a
--- /dev/null
+++ b/.github/workflows/linting.yml
@@ -0,0 +1,33 @@
+name: Linting
+on: [push, pull_request]
+
+jobs:
+ dependency-lint:
+ name: Dependency linting
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: EmbarkStudios/cargo-deny-action@v1
+ with:
+ arguments: --all-features
+ command-arguments: --allow license-not-encountered
+ code-lint:
+ name: Code linting
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ toolchain: nightly
+ components: clippy, rust-src
+ - run: cargo clippy --all-features -- --deny warnings
+ code-format:
+ name: Check formatting
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ toolchain: nightly
+ components: rustfmt, rust-src
+ - run: cargo fmt -- --check
diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml
new file mode 100644
index 0000000..f2616d9
--- /dev/null
+++ b/.github/workflows/testing.yml
@@ -0,0 +1,22 @@
+name: Testing
+on: [push, pull_request]
+
+jobs:
+ test:
+ strategy:
+ matrix:
+ os:
+ - ubuntu
+ - windows
+ - macos
+ rust:
+ - nightly
+ - stable
+ name: Test Rust ${{ matrix.rust }} on ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ toolchain: ${{ matrix.rust }}
+ - run: cargo test --all-features
diff --git a/deny.toml b/deny.toml
index b7e00b5..e1d1a8d 100644
--- a/deny.toml
+++ b/deny.toml
@@ -35,12 +35,7 @@ allow-osi-fsf-free = "neither"
default = "deny"
# Some crates require weird licenses, exceptions for those crates can be made here
-exceptions = [
- { allow = ["Unicode-DFS-2016"], name = "unicode-ident", version = "*" },
- { allow = ["Zlib"], name = "bevy_mikktspace", version = "*" },
- { allow = ["Zlib"], name = "adler32", version = "*" },
- { allow = ["Zlib"], name = "const_panic", version = "*" },
-]
+exceptions = []
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
diff --git a/flake.lock b/flake.lock
index 4d3b5f5..280716b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -3,11 +3,11 @@
"flake-compat": {
"flake": false,
"locked": {
- "lastModified": 1668681692,
- "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
+ "lastModified": 1673956053,
+ "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
- "rev": "009399224d5e398d03b22badca40a37ac85412a1",
+ "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
@@ -18,11 +18,11 @@
},
"flake-utils": {
"locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
+ "lastModified": 1676283394,
+ "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
+ "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
@@ -48,11 +48,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1669736245,
- "narHash": "sha256-LnuYZVNYd23+pE05PE/jw9w8b/MXmCOTqWP/OjCl7E0=",
+ "lastModified": 1677956512,
+ "narHash": "sha256-uiSU1yT1ipvzmmAXrstsgTbDts8t4JdF5Kx4SAFBEM4=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "e8b8afb2552b76e9ac2cf8b9245c9fe31f8ac9d2",
+ "rev": "f71c25b983d2724a3e98266ebee801088f504856",
"type": "github"
},
"original": {
@@ -92,11 +92,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
- "lastModified": 1669689198,
- "narHash": "sha256-YsWu3C9IGbH3+xguTzEDyQorFe/igr6FGZ+Q5T2ocxE=",
+ "lastModified": 1677896940,
+ "narHash": "sha256-F4YW6/+35dwctY4Ogb/vvMfvA6O0UwhDbXE7urDhk4A=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "4e093ce661a63aca4bcbace33695225eae4ef4e4",
+ "rev": "c25d3e1951863ac0061d47a3fabf9aa7c91db5e5",
"type": "github"
},
"original": {
diff --git a/src/lexer.rs b/src/lexer.rs
index 01d1ab6..88d86bd 100644
--- a/src/lexer.rs
+++ b/src/lexer.rs
@@ -199,7 +199,7 @@ impl<'a> Iterator for Lexer<'a> {
if self.peek() == Some('.') && self.peek_nth(1) != Some('.') {
self.advance();
value.push('.');
- while ('0'..='9').contains(&self.peek().unwrap()) {
+ while self.peek().unwrap().is_ascii_digit() {
value.push(self.advance().unwrap());
}
}