lintrunner 0.12.2__tar.gz → 0.12.3__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.

Potentially problematic release.


This version of lintrunner might be problematic. Click here for more details.

Files changed (69) hide show
  1. lintrunner-0.12.3/.github/workflows/CI.yml +149 -0
  2. {lintrunner-0.12.2 → lintrunner-0.12.3}/.github/workflows/Lint.yml +59 -59
  3. {lintrunner-0.12.2 → lintrunner-0.12.3}/.gitignore +86 -86
  4. {lintrunner-0.12.2 → lintrunner-0.12.3}/.lintrunner.toml +13 -13
  5. {lintrunner-0.12.2 → lintrunner-0.12.3}/CHANGELOG.md +186 -186
  6. {lintrunner-0.12.2 → lintrunner-0.12.3}/Cargo.lock +100 -103
  7. lintrunner-0.12.3/Cargo.toml +35 -0
  8. {lintrunner-0.12.2 → lintrunner-0.12.3}/LICENSE +21 -21
  9. {lintrunner-0.12.2 → lintrunner-0.12.3}/PKG-INFO +177 -177
  10. {lintrunner-0.12.2 → lintrunner-0.12.3}/README.md +176 -176
  11. {lintrunner-0.12.2 → lintrunner-0.12.3}/cliff.toml +63 -63
  12. {lintrunner-0.12.2 → lintrunner-0.12.3}/do_release.sh +13 -13
  13. {lintrunner-0.12.2 → lintrunner-0.12.3}/examples/config_example.toml +22 -22
  14. {lintrunner-0.12.2 → lintrunner-0.12.3}/examples/flake8_linter.py +397 -397
  15. {lintrunner-0.12.2 → lintrunner-0.12.3}/examples/rustfmt_linter.py +253 -253
  16. {lintrunner-0.12.2 → lintrunner-0.12.3}/pyproject.toml +18 -18
  17. {lintrunner-0.12.2 → lintrunner-0.12.3}/rustfmt.toml +6 -6
  18. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/git.rs +415 -415
  19. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/init.rs +49 -49
  20. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/lib.rs +335 -335
  21. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/lint_config.rs +252 -252
  22. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/lint_message.rs +63 -63
  23. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/linter.rs +227 -227
  24. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/log_utils.rs +104 -104
  25. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/main.rs +363 -363
  26. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/path.rs +143 -143
  27. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/persistent_data.rs +318 -318
  28. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/rage.rs +58 -58
  29. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/render.rs +376 -376
  30. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/sapling.rs +511 -511
  31. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/testing.rs +107 -107
  32. {lintrunner-0.12.2 → lintrunner-0.12.3}/src/version_control.rs +26 -26
  33. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/fixtures/fake_source_file.rs +33 -33
  34. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/integration_test.rs +919 -919
  35. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__changed_init_causes_warning_1.snap +12 -12
  36. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__changed_init_causes_warning_2.snap +12 -12
  37. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__duplicate_code_fails.snap +10 -10
  38. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__empty_command_fails.snap +11 -11
  39. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__excluding_dryrun_fails.snap +11 -11
  40. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__format_command_doesnt_use_nonformat_linter.snap +11 -11
  41. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__git_head_files.snap +36 -36
  42. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__git_no_changes.snap +35 -35
  43. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__init_suppresses_warning.snap +11 -11
  44. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__invalid_args.snap +16 -16
  45. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__invalid_config_fails.snap +11 -11
  46. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__invalid_paths_cmd_and_from.snap +15 -15
  47. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__invalid_paths_cmd_and_specified_paths.snap +15 -15
  48. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__lint_with_no_linters.snap +11 -11
  49. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__linter_hard_failure_is_caught.snap +26 -26
  50. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__linter_nonexistent_command.snap +21 -21
  51. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__linter_providing_nonexistent_path_degrades_gracefully.snap +20 -20
  52. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__linter_replacement_trailing_newlines.snap +29 -29
  53. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__no_op_config_succeeds.snap +12 -12
  54. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__rage_command_output.snap +12 -12
  55. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__simple_linter.snap +26 -26
  56. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__simple_linter_fails_on_nonexistent_file.snap +13 -13
  57. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__simple_linter_fake_second_config.snap +26 -26
  58. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__simple_linter_oneline.snap +12 -12
  59. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__simple_linter_only_under_dir.snap +11 -11
  60. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__simple_linter_replacement_message.snap +37 -37
  61. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__simple_linter_two_configs.snap +25 -25
  62. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__skip_nonexistent_linter.snap +11 -11
  63. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__take_nonexistent_linter.snap +11 -11
  64. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__tee_json.snap +6 -6
  65. {lintrunner-0.12.2 → lintrunner-0.12.3}/tests/snapshots/integration_test__unknown_config_fails.snap +12 -12
  66. {lintrunner-0.12.2 → lintrunner-0.12.3}/tools/convert_to_sarif.py +137 -137
  67. {lintrunner-0.12.2 → lintrunner-0.12.3}/tools/convert_to_sarif_test.py +179 -179
  68. lintrunner-0.12.2/.github/workflows/CI.yml +0 -119
  69. lintrunner-0.12.2/Cargo.toml +0 -35
@@ -0,0 +1,149 @@
1
+ # This file is autogenerated by maturin v1.4.0
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github
5
+ #
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ tags:
13
+ - 'v*'
14
+ pull_request:
15
+ workflow_dispatch:
16
+
17
+ concurrency:
18
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
19
+ cancel-in-progress: true
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ jobs:
25
+ test:
26
+ strategy:
27
+ fail-fast: false
28
+ matrix:
29
+ os: [ubuntu-latest, windows-latest, macos-latest]
30
+
31
+ runs-on: ${{ matrix.os }}
32
+ steps:
33
+ - uses: actions/checkout@v3
34
+ - uses: actions-rs/toolchain@v1
35
+ with:
36
+ toolchain: stable
37
+ - name: Initialize git config for testing
38
+ run: |
39
+ git config --global user.email "fake@email.com"
40
+ git config --global user.name "mr fake"
41
+ - name: Install and initialize sapling on macos
42
+ if: matrix.os == 'macos-latest'
43
+ run: |
44
+ brew install sapling
45
+ sl config --user ui.username "mr fake <fake@email.com>"
46
+ - name: Run cargo test
47
+ uses: nick-fields/retry@v2.8.2
48
+ env:
49
+ TMPDIR: ${{ runner.temp }}
50
+ with:
51
+ timeout_minutes: 10
52
+ max_attempts: 10
53
+ retry_wait_seconds: 90
54
+ command: |
55
+ cargo test
56
+
57
+ linux:
58
+ runs-on: ubuntu-latest
59
+ needs: test
60
+ strategy:
61
+ matrix:
62
+ target: [x86_64]
63
+ steps:
64
+ - uses: actions/checkout@v3
65
+ - name: Build wheels
66
+ uses: PyO3/maturin-action@v1
67
+ with:
68
+ target: ${{ matrix.target }}
69
+ args: --release --out dist
70
+ sccache: 'true'
71
+ manylinux: auto
72
+ - name: Upload wheels
73
+ uses: actions/upload-artifact@v3
74
+ with:
75
+ name: wheels
76
+ path: dist
77
+
78
+ windows:
79
+ runs-on: windows-latest
80
+ needs: test
81
+ strategy:
82
+ matrix:
83
+ target: [x86]
84
+ steps:
85
+ - uses: actions/checkout@v3
86
+ - name: Build wheels
87
+ uses: PyO3/maturin-action@v1
88
+ with:
89
+ target: ${{ matrix.target }}
90
+ args: --release --out dist
91
+ sccache: 'true'
92
+ - name: Upload wheels
93
+ uses: actions/upload-artifact@v3
94
+ with:
95
+ name: wheels
96
+ path: dist
97
+
98
+ macos:
99
+ runs-on: macos-latest
100
+ needs: test
101
+ strategy:
102
+ matrix:
103
+ target: [x86_64, aarch64]
104
+ steps:
105
+ - uses: actions/checkout@v3
106
+ - name: Build wheels
107
+ uses: PyO3/maturin-action@v1
108
+ with:
109
+ target: ${{ matrix.target }}
110
+ args: --release --out dist
111
+ sccache: 'true'
112
+ - name: Upload wheels
113
+ uses: actions/upload-artifact@v3
114
+ with:
115
+ name: wheels
116
+ path: dist
117
+
118
+ sdist:
119
+ runs-on: ubuntu-latest
120
+ needs: test
121
+ steps:
122
+ - uses: actions/checkout@v3
123
+ - name: Build sdist
124
+ uses: PyO3/maturin-action@v1
125
+ with:
126
+ command: sdist
127
+ args: --out dist
128
+ - name: Upload sdist
129
+ uses: actions/upload-artifact@v3
130
+ with:
131
+ name: wheels
132
+ path: dist
133
+
134
+ release:
135
+ name: Release
136
+ runs-on: ubuntu-latest
137
+ if: "startsWith(github.ref, 'refs/tags/')"
138
+ needs: [linux, windows, macos, sdist]
139
+ steps:
140
+ - uses: actions/download-artifact@v3
141
+ with:
142
+ name: wheels
143
+ - name: Publish to PyPI
144
+ uses: PyO3/maturin-action@v1
145
+ env:
146
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
147
+ with:
148
+ command: upload
149
+ args: --non-interactive --skip-existing *
@@ -1,59 +1,59 @@
1
- name: Lint
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- tags:
8
- - v*
9
- pull_request:
10
-
11
- concurrency:
12
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
13
- cancel-in-progress: true
14
-
15
- jobs:
16
- lintrunner:
17
- name: lintrunner
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- os: [ubuntu-latest, windows-latest]
22
- python_version: ["3.11"]
23
-
24
- runs-on: ${{ matrix.os }}
25
- steps:
26
- - uses: actions/checkout@v3
27
- - name: Setup Python
28
- uses: actions/setup-python@v4
29
- with:
30
- python-version: ${{ matrix.python_version }}
31
- - name: Install Lintrunner
32
- run: |
33
- pip install .
34
- lintrunner init
35
- - name: Run lintrunner on all files - Linux
36
- if: matrix.os != 'windows-latest'
37
- run: |
38
- set +e
39
- if ! lintrunner -v --force-color --all-files --tee-json=lint.json; then
40
- echo ""
41
- echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner -m main\`.\e[0m"
42
- exit 1
43
- fi
44
- - name: Run lintrunner on all files - Windows
45
- if: matrix.os == 'windows-latest'
46
- run: lintrunner -v --force-color --all-files
47
- - name: Produce SARIF
48
- if: always() && matrix.os == 'ubuntu-latest'
49
- run: |
50
- python tools/convert_to_sarif.py --input lint.json --output lintrunner.sarif
51
- - name: Upload SARIF file
52
- if: always() && matrix.os == 'ubuntu-latest'
53
- continue-on-error: true
54
- uses: github/codeql-action/upload-sarif@v2
55
- with:
56
- # Path to SARIF file relative to the root of the repository
57
- sarif_file: lintrunner.sarif
58
- category: lintrunner
59
- checkout_path: ${{ github.workspace }}
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - v*
9
+ pull_request:
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ lintrunner:
17
+ name: lintrunner
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os: [ubuntu-latest, windows-latest]
22
+ python_version: ["3.11"]
23
+
24
+ runs-on: ${{ matrix.os }}
25
+ steps:
26
+ - uses: actions/checkout@v3
27
+ - name: Setup Python
28
+ uses: actions/setup-python@v4
29
+ with:
30
+ python-version: ${{ matrix.python_version }}
31
+ - name: Install Lintrunner
32
+ run: |
33
+ pip install .
34
+ lintrunner init
35
+ - name: Run lintrunner on all files - Linux
36
+ if: matrix.os != 'windows-latest'
37
+ run: |
38
+ set +e
39
+ if ! lintrunner -v --force-color --all-files --tee-json=lint.json; then
40
+ echo ""
41
+ echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner -m main\`.\e[0m"
42
+ exit 1
43
+ fi
44
+ - name: Run lintrunner on all files - Windows
45
+ if: matrix.os == 'windows-latest'
46
+ run: lintrunner -v --force-color --all-files
47
+ - name: Produce SARIF
48
+ if: always() && matrix.os == 'ubuntu-latest'
49
+ run: |
50
+ python tools/convert_to_sarif.py --input lint.json --output lintrunner.sarif
51
+ - name: Upload SARIF file
52
+ if: always() && matrix.os == 'ubuntu-latest'
53
+ continue-on-error: true
54
+ uses: github/codeql-action/upload-sarif@v2
55
+ with:
56
+ # Path to SARIF file relative to the root of the repository
57
+ sarif_file: lintrunner.sarif
58
+ category: lintrunner
59
+ checkout_path: ${{ github.workspace }}
@@ -1,86 +1,86 @@
1
- # Generated by Cargo
2
- # will have compiled files and executables
3
- /target/
4
-
5
- # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6
- # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7
- Cargo.lock
8
-
9
- # These are backup files generated by rustfmt
10
- **/*.rs.bk
11
-
12
- # Ignore new insta snapshots
13
- tests/snapshots/*.new
14
-
15
-
16
- # Generated by Maturin
17
- # Byte-compiled / optimized / DLL files
18
- __pycache__/
19
- .pytest_cache/
20
- *.py[cod]
21
-
22
- # C extensions
23
- *.so
24
-
25
- # Distribution / packaging
26
- .Python
27
- .venv/
28
- env/
29
- bin/
30
- build/
31
- develop-eggs/
32
- dist/
33
- eggs/
34
- lib/
35
- lib64/
36
- parts/
37
- sdist/
38
- var/
39
- include/
40
- man/
41
- venv/
42
- *.egg-info/
43
- .installed.cfg
44
- *.egg
45
-
46
- # Installer logs
47
- pip-log.txt
48
- pip-delete-this-directory.txt
49
- pip-selfcheck.json
50
-
51
- # Unit test / coverage reports
52
- htmlcov/
53
- .tox/
54
- .coverage
55
- .cache
56
- nosetests.xml
57
- coverage.xml
58
-
59
- # Translations
60
- *.mo
61
-
62
- # Mr Developer
63
- .mr.developer.cfg
64
- .project
65
- .pydevproject
66
-
67
- # Rope
68
- .ropeproject
69
-
70
- # Django stuff:
71
- *.log
72
- *.pot
73
-
74
- .DS_Store
75
-
76
- # Sphinx documentation
77
- docs/_build/
78
-
79
- # PyCharm
80
- .idea/
81
-
82
- # VSCode
83
- .vscode/
84
-
85
- # Pyenv
86
- .python-version
1
+ # Generated by Cargo
2
+ # will have compiled files and executables
3
+ /target/
4
+
5
+ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6
+ # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7
+ Cargo.lock
8
+
9
+ # These are backup files generated by rustfmt
10
+ **/*.rs.bk
11
+
12
+ # Ignore new insta snapshots
13
+ tests/snapshots/*.new
14
+
15
+
16
+ # Generated by Maturin
17
+ # Byte-compiled / optimized / DLL files
18
+ __pycache__/
19
+ .pytest_cache/
20
+ *.py[cod]
21
+
22
+ # C extensions
23
+ *.so
24
+
25
+ # Distribution / packaging
26
+ .Python
27
+ .venv/
28
+ env/
29
+ bin/
30
+ build/
31
+ develop-eggs/
32
+ dist/
33
+ eggs/
34
+ lib/
35
+ lib64/
36
+ parts/
37
+ sdist/
38
+ var/
39
+ include/
40
+ man/
41
+ venv/
42
+ *.egg-info/
43
+ .installed.cfg
44
+ *.egg
45
+
46
+ # Installer logs
47
+ pip-log.txt
48
+ pip-delete-this-directory.txt
49
+ pip-selfcheck.json
50
+
51
+ # Unit test / coverage reports
52
+ htmlcov/
53
+ .tox/
54
+ .coverage
55
+ .cache
56
+ nosetests.xml
57
+ coverage.xml
58
+
59
+ # Translations
60
+ *.mo
61
+
62
+ # Mr Developer
63
+ .mr.developer.cfg
64
+ .project
65
+ .pydevproject
66
+
67
+ # Rope
68
+ .ropeproject
69
+
70
+ # Django stuff:
71
+ *.log
72
+ *.pot
73
+
74
+ .DS_Store
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyCharm
80
+ .idea/
81
+
82
+ # VSCode
83
+ .vscode/
84
+
85
+ # Pyenv
86
+ .python-version
@@ -1,13 +1,13 @@
1
- merge_base_with="main"
2
-
3
- [[linter]]
4
- code = 'RUSTFMT'
5
- include_patterns = ['**/*.rs']
6
- command = [
7
- 'python',
8
- 'examples/rustfmt_linter.py',
9
- '--binary=rustfmt',
10
- '--config-path=rustfmt.toml',
11
- '--',
12
- '@{{PATHSFILE}}'
13
- ]
1
+ merge_base_with="main"
2
+
3
+ [[linter]]
4
+ code = 'RUSTFMT'
5
+ include_patterns = ['**/*.rs']
6
+ command = [
7
+ 'python',
8
+ 'examples/rustfmt_linter.py',
9
+ '--binary=rustfmt',
10
+ '--config-path=rustfmt.toml',
11
+ '--',
12
+ '@{{PATHSFILE}}'
13
+ ]