devobs 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {devobs-0.2.0 → devobs-0.2.2}/.devcontainer/devcontainer.json +1 -1
  2. {devobs-0.2.0 → devobs-0.2.2}/.devcontainer/onCreateCommand.sh +0 -0
  3. {devobs-0.2.0 → devobs-0.2.2}/.devcontainer/postAttachCommand.sh +0 -0
  4. {devobs-0.2.0 → devobs-0.2.2}/.github/workflows/ci.yaml +7 -11
  5. devobs-0.2.2/.github/workflows/prepare-release.yaml +51 -0
  6. {devobs-0.2.0 → devobs-0.2.2}/.github/workflows/release.yaml +18 -21
  7. {devobs-0.2.0 → devobs-0.2.2}/.pre-commit-config.yaml +9 -10
  8. devobs-0.2.2/.pre-commit-hooks.yaml +22 -0
  9. {devobs-0.2.0 → devobs-0.2.2}/Cargo.lock +508 -187
  10. {devobs-0.2.0 → devobs-0.2.2}/Cargo.toml +6 -6
  11. {devobs-0.2.0 → devobs-0.2.2}/PKG-INFO +2 -1
  12. devobs-0.2.0/.pre-commit-hooks.yaml +0 -7
  13. {devobs-0.2.0 → devobs-0.2.2}/.config/nextest.toml +0 -0
  14. {devobs-0.2.0 → devobs-0.2.2}/.editorconfig +0 -0
  15. {devobs-0.2.0 → devobs-0.2.2}/.gitattributes +0 -0
  16. {devobs-0.2.0 → devobs-0.2.2}/.github/dependabot.yaml +0 -0
  17. {devobs-0.2.0 → devobs-0.2.2}/.gitignore +0 -0
  18. {devobs-0.2.0 → devobs-0.2.2}/.rustfmt.toml +0 -0
  19. {devobs-0.2.0 → devobs-0.2.2}/.vscode/extensions.json +0 -0
  20. {devobs-0.2.0 → devobs-0.2.2}/.vscode/launch.json +0 -0
  21. {devobs-0.2.0 → devobs-0.2.2}/.vscode/settings.json +0 -0
  22. {devobs-0.2.0 → devobs-0.2.2}/LICENSE +0 -0
  23. {devobs-0.2.0 → devobs-0.2.2}/Makefile +0 -0
  24. {devobs-0.2.0 → devobs-0.2.2}/README.md +0 -0
  25. {devobs-0.2.0 → devobs-0.2.2}/pyproject.toml +0 -0
  26. {devobs-0.2.0 → devobs-0.2.2}/rust-toolchain.toml +0 -0
  27. {devobs-0.2.0 → devobs-0.2.2}/src/commands/assert_diff.rs +0 -0
  28. {devobs-0.2.0 → devobs-0.2.2}/src/commands/check_file_pair.rs +0 -0
  29. {devobs-0.2.0 → devobs-0.2.2}/src/commands.rs +0 -0
  30. {devobs-0.2.0 → devobs-0.2.2}/src/main.rs +0 -0
  31. {devobs-0.2.0 → devobs-0.2.2}/src/utils/fs.rs +0 -0
  32. {devobs-0.2.0 → devobs-0.2.2}/src/utils.rs +0 -0
  33. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/mod.rs +0 -0
  34. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__changes_create-2.snap +0 -0
  35. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__changes_create.snap +0 -0
  36. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__changes_delete-2.snap +0 -0
  37. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__changes_delete.snap +0 -0
  38. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__changes_modify-2.snap +0 -0
  39. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__changes_modify.snap +0 -0
  40. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__empty_directory.snap +0 -0
  41. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__no_changes.snap +0 -0
  42. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__no_command_to_run.snap +0 -0
  43. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__nonexistent_directory.snap +0 -0
  44. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__on_command_error_ignore.snap +0 -0
  45. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_assert_diff__on_command_error_propagate.snap +0 -0
  46. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_check_file_pair__backward_matching.snap +0 -0
  47. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_check_file_pair__create_if_not_exists.snap +0 -0
  48. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_check_file_pair__create_if_not_exists_dry_run.snap +0 -0
  49. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_check_file_pair__empty_directory_no_error_no_output.snap +0 -0
  50. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_check_file_pair__forward_matching.snap +0 -0
  51. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/snapshots/integration_test__commands__test_check_file_pair__on_fully_populated_directory.snap +0 -0
  52. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/test_assert_diff.rs +0 -0
  53. {devobs-0.2.0 → devobs-0.2.2}/tests/commands/test_check_file_pair.rs +0 -0
  54. {devobs-0.2.0 → devobs-0.2.2}/tests/helpers.rs +0 -0
  55. {devobs-0.2.0 → devobs-0.2.2}/tests/integration_test.rs +0 -0
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "lasuillard/devobs",
2
+ "name": "lasuillard-s/devobs",
3
3
  "image": "mcr.microsoft.com/devcontainers/rust:1-bookworm",
4
4
  "features": {
5
5
  "ghcr.io/devcontainers-extra/features/pre-commit:2": {}
@@ -6,22 +6,20 @@ on:
6
6
  pull_request:
7
7
  branches: [main]
8
8
 
9
- permissions: read-all
10
-
11
9
  jobs:
12
10
  lint:
13
- name: Lint
14
11
  runs-on: ubuntu-latest
15
12
  timeout-minutes: 10
13
+ permissions:
14
+ contents: read
16
15
  steps:
17
- - name: Checkout
18
- uses: actions/checkout@v5
16
+ - uses: actions/checkout@v6
19
17
 
20
18
  - name: Set up Rust
21
19
  run: rustup show
22
20
 
23
21
  - name: Manage Rust cache
24
- uses: Swatinem/rust-cache@v2
22
+ uses: Swatinem/rust-cache@v2.8.1
25
23
 
26
24
  - name: Check code formatting
27
25
  run: cargo fmt --check
@@ -30,24 +28,22 @@ jobs:
30
28
  run: cargo clippy
31
29
 
32
30
  test:
33
- name: Test
34
31
  runs-on: ubuntu-latest
35
32
  timeout-minutes: 10
36
33
  permissions:
37
34
  contents: read
38
35
  id-token: write
39
36
  steps:
40
- - name: Checkout
41
- uses: actions/checkout@v5
37
+ - uses: actions/checkout@v6
42
38
 
43
39
  - name: Set up Rust
44
40
  run: rustup show
45
41
 
46
42
  - name: Manage Rust cache
47
- uses: Swatinem/rust-cache@v2
43
+ uses: Swatinem/rust-cache@v2.8.1
48
44
 
49
45
  - name: Install devtools
50
- uses: taiki-e/install-action@v2
46
+ uses: taiki-e/install-action@v2.62.48
51
47
  with:
52
48
  tool: cargo-binstall,cargo-llvm-cov,cargo-nextest
53
49
 
@@ -0,0 +1,51 @@
1
+ name: Prepare Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tag:
7
+ description: Semver-style tag for release (e.g., v1.0.0)
8
+ required: true
9
+
10
+ jobs:
11
+ create-pr:
12
+ runs-on: ubuntu-latest
13
+ timeout-minutes: 5
14
+ permissions:
15
+ contents: write
16
+ pull-requests: write
17
+ steps:
18
+ # TODO(lasuillard): Validate tag format more strictly (semver)
19
+ - name: Check tag format
20
+ run: |
21
+ if [[ ! "${{ inputs.tag }}" =~ ^v ]]; then
22
+ echo "Tag must start with 'v'"
23
+ exit 1
24
+ fi
25
+
26
+ - uses: actions/checkout@v6
27
+
28
+ # https://github.com/killercup/cargo-edit/issues/864
29
+ - name: Set version
30
+ run: |
31
+ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
32
+ brew install cargo-edit
33
+ tag="${{ inputs.tag }}"
34
+ tag_no_v="${tag#v}"
35
+ cargo set-version "$tag_no_v"
36
+
37
+ - name: Generate GitHub App token
38
+ uses: actions/create-github-app-token@v2
39
+ id: generate-token
40
+ with:
41
+ app-id: ${{ vars.GH_APP_ID }}
42
+ private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
43
+
44
+ - name: Create pull request
45
+ uses: peter-evans/create-pull-request@v8.0.0
46
+ with:
47
+ token: ${{ steps.generate-token.outputs.token }}
48
+ sign-commits: true
49
+ title: Release ${{ inputs.tag }}
50
+ branch: release/${{ inputs.tag }}
51
+ delete-branch: true
@@ -1,13 +1,8 @@
1
1
  name: Release
2
2
 
3
3
  on:
4
- push:
5
- branches:
6
- - main
7
- tags:
8
- - v*
9
-
10
- permissions: read-all
4
+ release:
5
+ types: [published]
11
6
 
12
7
  jobs:
13
8
  build:
@@ -18,12 +13,13 @@ jobs:
18
13
  - platform: ubuntu-latest
19
14
  target: x86_64
20
15
 
21
- name: Build (${{ matrix.target }})
16
+ name: build (${{ matrix.target }})
22
17
  runs-on: ${{ matrix.platform }}
23
18
  timeout-minutes: 15
19
+ permissions:
20
+ contents: read
24
21
  steps:
25
- - name: Checkout
26
- uses: actions/checkout@v5
22
+ - uses: actions/checkout@v6
27
23
 
28
24
  - name: Build wheels
29
25
  uses: PyO3/maturin-action@v1
@@ -32,7 +28,7 @@ jobs:
32
28
  args: --release --out dist
33
29
 
34
30
  - name: Upload wheels as artifact
35
- uses: actions/upload-artifact@v4
31
+ uses: actions/upload-artifact@v6
36
32
  with:
37
33
  name: dist-${{ matrix.target }}
38
34
  path: dist
@@ -40,9 +36,10 @@ jobs:
40
36
  sdist:
41
37
  runs-on: ubuntu-latest
42
38
  timeout-minutes: 15
39
+ permissions:
40
+ contents: read
43
41
  steps:
44
- - name: Checkout
45
- uses: actions/checkout@v5
42
+ - uses: actions/checkout@v6
46
43
 
47
44
  - name: Build sdist
48
45
  uses: PyO3/maturin-action@v1
@@ -51,24 +48,22 @@ jobs:
51
48
  args: --out dist
52
49
 
53
50
  - name: Upload sdist as artifact
54
- uses: actions/upload-artifact@v4
51
+ uses: actions/upload-artifact@v6
55
52
  with:
56
53
  name: sdist
57
54
  path: dist
58
55
 
59
56
  release:
60
- name: Release
61
57
  needs:
62
58
  - build
63
59
  - sdist
64
60
  runs-on: ubuntu-latest
65
- if: startsWith(github.ref, 'refs/tags/v')
66
61
  timeout-minutes: 5
67
62
  permissions:
68
63
  contents: write
69
64
  steps:
70
65
  - name: Download binary artifacts
71
- uses: actions/download-artifact@v5
66
+ uses: actions/download-artifact@v7
72
67
  with:
73
68
  path: dist
74
69
 
@@ -76,13 +71,15 @@ jobs:
76
71
  run: ls -l --all --recursive dist
77
72
 
78
73
  - name: Create release
79
- uses: softprops/action-gh-release@v2
74
+ uses: softprops/action-gh-release@v2.5.0
80
75
  with:
76
+ tag_name: ${{ github.event.release.tag_name }}
81
77
  generate_release_notes: true
82
- files: dist/*
78
+ files: |
79
+ dist/sdist/devobs-*.tar.gz
80
+ dist/dist-*/devobs-*.whl
83
81
 
84
82
  publish-pypi:
85
- name: Publish to PyPI
86
83
  needs: release
87
84
  runs-on: ubuntu-latest
88
85
  environment: pypi
@@ -91,7 +88,7 @@ jobs:
91
88
  id-token: write
92
89
  steps:
93
90
  - name: Download binary artifacts
94
- uses: actions/download-artifact@v5
91
+ uses: actions/download-artifact@v7
95
92
  with:
96
93
  path: dist
97
94
  merge-multiple: true
@@ -6,24 +6,23 @@ exclude: |
6
6
  )
7
7
  repos:
8
8
  - repo: https://github.com/pre-commit/pre-commit-hooks
9
- rev: v4.5.0
9
+ rev: v6.0.0
10
10
  hooks:
11
11
  - id: trailing-whitespace
12
12
  - id: end-of-file-fixer
13
13
 
14
- # TODO(lasuillard): For testing. Later need to be improved with config file support.
15
- - repo: https://github.com/lasuillard/devobs
16
- rev: v0.1.0
14
+ - repo: https://github.com/lasuillard-s/devobs
15
+ rev: main # Dogfooding; pin to a specific version when stable
17
16
  hooks:
18
- # Require each commands to have a matching integration tests.
19
- - id: devobs
20
- pass_filenames: false
17
+ # Ensure each command has its test file pair
18
+ - id: check-file-pair
21
19
  args:
22
- - check-file-pair
20
+ - --log-level
21
+ - trace
23
22
  - --from=src/commands
24
23
  - --to=tests/commands
25
- - --include='*.rs'
26
- - --expect='{to}/{relative_from}/test_{filename}'
24
+ - --include=*.rs
25
+ - --expect={to}/{relative_from}/test_{filename}
27
26
 
28
27
  - repo: local
29
28
  hooks:
@@ -0,0 +1,22 @@
1
+ # NOTE: We use pipx to run the devobs commands, otherwise it would require users
2
+ # to install Rust toolchain and dependencies to build the project.
3
+ # * This hook configuration file is updated separately from the latest release,
4
+ # * so the version specified in entry may not always be the latest one.
5
+ - id: devobs
6
+ name: devobs
7
+ description: Run devobs commands using pipx
8
+ language: system
9
+ entry: pipx run 'devobs~=0.2.0'
10
+
11
+ # Shortcuts for each command for convenience
12
+ - id: check-file-pair
13
+ name: check-file-pair
14
+ language: system
15
+ entry: pipx run 'devobs~=0.2.0' check-file-pair
16
+ pass_filenames: false
17
+
18
+ - id: assert-diff
19
+ name: assert-diff
20
+ language: system
21
+ entry: pipx run 'devobs~=0.2.0' assert-diff
22
+ pass_filenames: false