Skip to content
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

GitHub Actions linter for Rust formatting #1604

Merged
merged 3 commits into from
Sep 12, 2024
Merged
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
30 changes: 30 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linters

on:
push:
branches:
- main
pull_request:
branches:
- main
# Only run when linted files change
paths:
- 'functional-tests/**/*.rs'

permissions:
contents: read

jobs:
lint:
name: Lint Rust source files
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

duthils marked this conversation as resolved.
Show resolved Hide resolved
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.70.0

- name: Run Formatting Check
run: cargo fmt --check
working-directory: ./functional-tests
12 changes: 8 additions & 4 deletions functional-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,10 @@ b: ba"#
#[test]
fn unset_json_file() {
// Test removal of tree branch
let file_path =
prepare_temp_file("test_unset.json", r#"{"a": 2, "b": "ba", "c": [1,2]}"#.as_bytes());
let file_path = prepare_temp_file(
"test_unset.json",
r#"{"a": 2, "b": "ba", "c": [1,2]}"#.as_bytes(),
);
assert!(
Command::new(SOPS_BINARY_PATH)
.arg("encrypt")
Expand Down Expand Up @@ -661,8 +663,10 @@ b: ba"#
#[test]
fn unset_yaml_file() {
// Test removal of tree branch
let file_path =
prepare_temp_file("test_unset.yaml", r#"{"a": 2, "b": "ba", "c": [1,2]}"#.as_bytes());
let file_path = prepare_temp_file(
"test_unset.yaml",
r#"{"a": 2, "b": "ba", "c": [1,2]}"#.as_bytes(),
);
assert!(
Command::new(SOPS_BINARY_PATH)
.arg("encrypt")
Expand Down
Loading