simplint 0.1.0__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 (253) hide show
  1. simplint-0.1.0/CHANGELOG.md +12 -0
  2. simplint-0.1.0/CODE_OF_CONDUCT.md +50 -0
  3. simplint-0.1.0/CONTRIBUTING.md +117 -0
  4. simplint-0.1.0/Cargo.lock +1469 -0
  5. simplint-0.1.0/Cargo.toml +37 -0
  6. simplint-0.1.0/LICENSE.txt +21 -0
  7. simplint-0.1.0/PKG-INFO +147 -0
  8. simplint-0.1.0/README.md +14 -0
  9. simplint-0.1.0/README.rst +116 -0
  10. simplint-0.1.0/codecov.yml +20 -0
  11. simplint-0.1.0/docs/__init__.py +0 -0
  12. simplint-0.1.0/docs/conf.py +129 -0
  13. simplint-0.1.0/docs/configuration.rst +59 -0
  14. simplint-0.1.0/docs/index.rst +92 -0
  15. simplint-0.1.0/docs/rules.rst +23 -0
  16. simplint-0.1.0/ignore-words.txt +5 -0
  17. simplint-0.1.0/pylock.toml +2922 -0
  18. simplint-0.1.0/pyproject.toml +215 -0
  19. simplint-0.1.0/resources/test/fixtures/SMP001.py +21 -0
  20. simplint-0.1.0/resources/test/fixtures/SMP002.py +22 -0
  21. simplint-0.1.0/resources/test/fixtures/SMP003.py +4 -0
  22. simplint-0.1.0/resources/test/fixtures/SMP003_ok.py +1 -0
  23. simplint-0.1.0/resources/test/fixtures/SMP005.py +26 -0
  24. simplint-0.1.0/resources/test/fixtures/SMP010.py +35 -0
  25. simplint-0.1.0/resources/test/fixtures/SMP020.py +124 -0
  26. simplint-0.1.0/resources/test/fixtures/SMP020_annotations.py +11 -0
  27. simplint-0.1.0/resources/test/fixtures/SMP020_floating.py +8 -0
  28. simplint-0.1.0/resources/test/fixtures/SMP020_nonl.py +6 -0
  29. simplint-0.1.0/resources/test/fixtures/SMP030.py +47 -0
  30. simplint-0.1.0/resources/test/fixtures/SMP040.py +42 -0
  31. simplint-0.1.0/resources/test/fixtures/SMP050.py +47 -0
  32. simplint-0.1.0/resources/test/fixtures/SMP050_all.py +21 -0
  33. simplint-0.1.0/resources/test/fixtures/SMP050_dynamic.py +9 -0
  34. simplint-0.1.0/resources/test/fixtures/SMP050_spacing.py +13 -0
  35. simplint-0.1.0/resources/test/fixtures/SMP060.py +13 -0
  36. simplint-0.1.0/resources/test/fixtures/SMP100.py +84 -0
  37. simplint-0.1.0/resources/test/fixtures/SMP101.py +19 -0
  38. simplint-0.1.0/resources/test/fixtures/SMP101_bare.py +4 -0
  39. simplint-0.1.0/resources/test/fixtures/SMP101_checking.py +6 -0
  40. simplint-0.1.0/resources/test/fixtures/SMP101_future.py +8 -0
  41. simplint-0.1.0/resources/test/fixtures/SMP101_module.py +7 -0
  42. simplint-0.1.0/resources/test/fixtures/SMP101_new.py +5 -0
  43. simplint-0.1.0/resources/test/fixtures/SMP101_typing.py +3 -0
  44. simplint-0.1.0/resources/test/fixtures/SMP102.py +25 -0
  45. simplint-0.1.0/resources/test/fixtures/SMP102_ann.py +3 -0
  46. simplint-0.1.0/resources/test/fixtures/SMP102_call.py +3 -0
  47. simplint-0.1.0/resources/test/fixtures/SMP102_conflict.py +3 -0
  48. simplint-0.1.0/resources/test/fixtures/SMP102_noall.py +10 -0
  49. simplint-0.1.0/resources/test/fixtures/SMP102_rename.py +51 -0
  50. simplint-0.1.0/resources/test/fixtures/SMP102_scopes.py +60 -0
  51. simplint-0.1.0/resources/test/fixtures/SMP103.py +28 -0
  52. simplint-0.1.0/resources/test/fixtures/SMP103_extend.py +19 -0
  53. simplint-0.1.0/resources/test/fixtures/SMP103_remove.py +10 -0
  54. simplint-0.1.0/resources/test/fixtures/SMP104.py +9 -0
  55. simplint-0.1.0/resources/test/fixtures/SMP104_ann.py +7 -0
  56. simplint-0.1.0/resources/test/fixtures/SMP104_eof.py +2 -0
  57. simplint-0.1.0/resources/test/fixtures/SMP104_negated.py +9 -0
  58. simplint-0.1.0/resources/test/fixtures/SMP104_nonl.py +2 -0
  59. simplint-0.1.0/resources/test/fixtures/SMP104_reversed.py +9 -0
  60. simplint-0.1.0/resources/test/fixtures/SMP105.py +10 -0
  61. simplint-0.1.0/resources/test/fixtures/SMP106.py +22 -0
  62. simplint-0.1.0/resources/test/fixtures/SMP107.py +10 -0
  63. simplint-0.1.0/resources/test/fixtures/SMP107_bound.py +5 -0
  64. simplint-0.1.0/resources/test/fixtures/SMP108.py +5 -0
  65. simplint-0.1.0/resources/test/fixtures/SMP108_checking.py +9 -0
  66. simplint-0.1.0/resources/test/fixtures/SMP108_joined.py +3 -0
  67. simplint-0.1.0/resources/test/fixtures/SMP111.py +78 -0
  68. simplint-0.1.0/resources/test/fixtures/SMP112.py +23 -0
  69. simplint-0.1.0/resources/test/fixtures/SMP112_old.py +2 -0
  70. simplint-0.1.0/resources/test/fixtures/SMP113.py +12 -0
  71. simplint-0.1.0/resources/test/fixtures/SMP113_aug.py +6 -0
  72. simplint-0.1.0/resources/test/fixtures/SMP113_call.py +5 -0
  73. simplint-0.1.0/resources/test/fixtures/SMP113_empty.py +5 -0
  74. simplint-0.1.0/resources/test/fixtures/SMP113_multiline.py +13 -0
  75. simplint-0.1.0/resources/test/fixtures/SMP113_noall.py +2 -0
  76. simplint-0.1.0/resources/test/fixtures/SMP113_scripts.py +2 -0
  77. simplint-0.1.0/resources/test/fixtures/SMP114.py +22 -0
  78. simplint-0.1.0/resources/test/fixtures/SMP205.py +33 -0
  79. simplint-0.1.0/resources/test/fixtures/consumer/use.py +23 -0
  80. simplint-0.1.0/resources/test/fixtures/package/__init__.py +5 -0
  81. simplint-0.1.0/resources/test/fixtures/package/sub/__init__.py +1 -0
  82. simplint-0.1.0/resources/test/fixtures/package/sub/module.py +7 -0
  83. simplint-0.1.0/resources/test/fixtures/package/sub/script.py +4 -0
  84. simplint-0.1.0/resources/test/fixtures/tests/test_SMP004.py +7 -0
  85. simplint-0.1.0/resources/test/fixtures/tests/test_SMP200.py +97 -0
  86. simplint-0.1.0/resources/test/fixtures/tests/test_SMP201.py +33 -0
  87. simplint-0.1.0/resources/test/fixtures/tests/test_SMP202.py +31 -0
  88. simplint-0.1.0/resources/test/fixtures/tests/test_SMP203.py +40 -0
  89. simplint-0.1.0/resources/test/fixtures/tests/test_SMP204.py +29 -0
  90. simplint-0.1.0/rust-toolchain.toml +2 -0
  91. simplint-0.1.0/src/checker.rs +119 -0
  92. simplint-0.1.0/src/fix.rs +43 -0
  93. simplint-0.1.0/src/guards.rs +21 -0
  94. simplint-0.1.0/src/linter.rs +54 -0
  95. simplint-0.1.0/src/main.rs +270 -0
  96. simplint-0.1.0/src/noqa.rs +57 -0
  97. simplint-0.1.0/src/project.rs +202 -0
  98. simplint-0.1.0/src/registry.rs +140 -0
  99. simplint-0.1.0/src/rules/comments.rs +219 -0
  100. simplint-0.1.0/src/rules/constants.rs +336 -0
  101. simplint-0.1.0/src/rules/dataclasses.rs +133 -0
  102. simplint-0.1.0/src/rules/docs/SMP001.md +31 -0
  103. simplint-0.1.0/src/rules/docs/SMP002.md +30 -0
  104. simplint-0.1.0/src/rules/docs/SMP003.md +28 -0
  105. simplint-0.1.0/src/rules/docs/SMP004.md +34 -0
  106. simplint-0.1.0/src/rules/docs/SMP005.md +33 -0
  107. simplint-0.1.0/src/rules/docs/SMP010.md +31 -0
  108. simplint-0.1.0/src/rules/docs/SMP020.md +50 -0
  109. simplint-0.1.0/src/rules/docs/SMP030.md +36 -0
  110. simplint-0.1.0/src/rules/docs/SMP040.md +36 -0
  111. simplint-0.1.0/src/rules/docs/SMP050.md +40 -0
  112. simplint-0.1.0/src/rules/docs/SMP060.md +32 -0
  113. simplint-0.1.0/src/rules/docs/SMP100.md +45 -0
  114. simplint-0.1.0/src/rules/docs/SMP101.md +39 -0
  115. simplint-0.1.0/src/rules/docs/SMP102.md +40 -0
  116. simplint-0.1.0/src/rules/docs/SMP103.md +48 -0
  117. simplint-0.1.0/src/rules/docs/SMP104.md +45 -0
  118. simplint-0.1.0/src/rules/docs/SMP105.md +33 -0
  119. simplint-0.1.0/src/rules/docs/SMP106.md +29 -0
  120. simplint-0.1.0/src/rules/docs/SMP107.md +31 -0
  121. simplint-0.1.0/src/rules/docs/SMP108.md +28 -0
  122. simplint-0.1.0/src/rules/docs/SMP109.md +32 -0
  123. simplint-0.1.0/src/rules/docs/SMP110.md +32 -0
  124. simplint-0.1.0/src/rules/docs/SMP111.md +33 -0
  125. simplint-0.1.0/src/rules/docs/SMP112.md +29 -0
  126. simplint-0.1.0/src/rules/docs/SMP113.md +44 -0
  127. simplint-0.1.0/src/rules/docs/SMP114.md +36 -0
  128. simplint-0.1.0/src/rules/docs/SMP200.md +34 -0
  129. simplint-0.1.0/src/rules/docs/SMP201.md +42 -0
  130. simplint-0.1.0/src/rules/docs/SMP202.md +39 -0
  131. simplint-0.1.0/src/rules/docs/SMP203.md +32 -0
  132. simplint-0.1.0/src/rules/docs/SMP204.md +32 -0
  133. simplint-0.1.0/src/rules/docs/SMP205.md +32 -0
  134. simplint-0.1.0/src/rules/docstrings.rs +83 -0
  135. simplint-0.1.0/src/rules/exports.rs +141 -0
  136. simplint-0.1.0/src/rules/functions.rs +91 -0
  137. simplint-0.1.0/src/rules/imports.rs +215 -0
  138. simplint-0.1.0/src/rules/mocks.rs +212 -0
  139. simplint-0.1.0/src/rules/mod.rs +303 -0
  140. simplint-0.1.0/src/rules/names.rs +249 -0
  141. simplint-0.1.0/src/rules/order.rs +279 -0
  142. simplint-0.1.0/src/rules/pytest.rs +280 -0
  143. simplint-0.1.0/src/rules/strings.rs +132 -0
  144. simplint-0.1.0/src/rules/typing.rs +146 -0
  145. simplint-0.1.0/src/rules/walrus.rs +138 -0
  146. simplint-0.1.0/src/semantic.rs +474 -0
  147. simplint-0.1.0/src/settings.rs +197 -0
  148. simplint-0.1.0/src/snapshot.rs +69 -0
  149. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP001_SMP001.py.snap +26 -0
  150. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP002_SMP002.py.snap +28 -0
  151. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP003_SMP003.py.snap +5 -0
  152. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP003_SMP003_ok.py.snap +5 -0
  153. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP003_tests_test_SMP004.py.snap +5 -0
  154. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP004_SMP003.py.snap +5 -0
  155. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP004_tests_test_SMP004.py.snap +11 -0
  156. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP005_SMP005.py.snap +7 -0
  157. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP010_SMP010.py.snap +18 -0
  158. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP020_SMP020.py.snap +136 -0
  159. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP020_SMP020_annotations.py.snap +18 -0
  160. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP020_SMP020_annotations.py_py310.snap +5 -0
  161. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP020_SMP020_floating.py.snap +5 -0
  162. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP020_SMP020_nonl.py.snap +12 -0
  163. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP030_SMP030.py.snap +7 -0
  164. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP040_SMP040.py.snap +40 -0
  165. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP040_SMP040.py_py310.snap +42 -0
  166. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP050_SMP050.py.snap +53 -0
  167. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP050_SMP050_all.py.snap +30 -0
  168. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP050_SMP050_dynamic.py.snap +14 -0
  169. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP050_SMP050_spacing.py.snap +16 -0
  170. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP060_SMP060.py.snap +11 -0
  171. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP100_SMP100.py.snap +89 -0
  172. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101.py.snap +31 -0
  173. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101_bare.py.snap +12 -0
  174. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101_checking.py.snap +12 -0
  175. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101_checking.py_py310.snap +12 -0
  176. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101_future.py_py310.snap +14 -0
  177. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101_module.py.snap +13 -0
  178. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101_new.py.snap +12 -0
  179. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP101_SMP101_typing.py.snap +9 -0
  180. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP102_SMP102.py.snap +34 -0
  181. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP102_SMP102_ann.py.snap +9 -0
  182. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP102_SMP102_call.py.snap +4 -0
  183. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP102_SMP102_conflict.py.snap +10 -0
  184. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP102_SMP102_noall.py.snap +18 -0
  185. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP102_SMP102_rename.py.snap +57 -0
  186. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP102_SMP102_scopes.py.snap +5 -0
  187. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP103_SMP003_ok.py.snap +5 -0
  188. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP103_SMP103.py.snap +35 -0
  189. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP103_SMP103_extend.py.snap +25 -0
  190. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP103_SMP103_remove.py.snap +5 -0
  191. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP103_tests_test_SMP004.py.snap +5 -0
  192. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP104_SMP003_ok.py.snap +5 -0
  193. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP104_SMP104.py.snap +15 -0
  194. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP104_SMP104_ann.py.snap +5 -0
  195. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP104_SMP104_eof.py.snap +10 -0
  196. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP104_SMP104_negated.py.snap +15 -0
  197. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP104_SMP104_nonl.py.snap +9 -0
  198. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP104_SMP104_reversed.py.snap +15 -0
  199. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP105_SMP105.py.snap +6 -0
  200. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP106_SMP106.py.snap +7 -0
  201. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP107_SMP107.py.snap +5 -0
  202. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP107_SMP107_bound.py.snap +5 -0
  203. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP108_SMP108.py.snap +11 -0
  204. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP108_SMP108.py_py310.snap +5 -0
  205. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP108_SMP108_checking.py.snap +14 -0
  206. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP108_SMP108_joined.py.snap +5 -0
  207. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP109_SMP003_ok.py.snap +5 -0
  208. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP109_package___init__.py.snap +6 -0
  209. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP109_package_sub___init__.py.snap +5 -0
  210. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP110_SMP003_ok.py.snap +5 -0
  211. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP110_package___init__.py.snap +11 -0
  212. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP110_package_sub_module.py.snap +14 -0
  213. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP110_package_sub_script.py.snap +10 -0
  214. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP111_SMP111.py.snap +93 -0
  215. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP112_SMP112.py.snap +42 -0
  216. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP112_SMP112_old.py_py310.snap +5 -0
  217. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_SMP113.py.snap +19 -0
  218. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_SMP113_aug.py.snap +12 -0
  219. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_SMP113_call.py.snap +4 -0
  220. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_SMP113_empty.py.snap +11 -0
  221. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_SMP113_multiline.py.snap +20 -0
  222. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_SMP113_noall.py.snap +11 -0
  223. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_SMP113_scripts.py.snap +11 -0
  224. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_package___init__.py.snap +5 -0
  225. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP113_tests_test_SMP004.py.snap +5 -0
  226. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP114_SMP114.py.snap +30 -0
  227. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP200_SMP003_ok.py.snap +5 -0
  228. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP200_tests_test_SMP200.py.snap +112 -0
  229. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP201_tests_test_SMP201.py.snap +6 -0
  230. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP202_SMP003_ok.py.snap +5 -0
  231. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP202_tests_test_SMP202.py.snap +7 -0
  232. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP203_tests_test_SMP203.py.snap +45 -0
  233. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP204_tests_test_SMP204.py.snap +8 -0
  234. simplint-0.1.0/src/snapshots/simplint__snapshot__SMP205_SMP205.py.snap +43 -0
  235. simplint-0.1.0/tasks/assemble_release.py +88 -0
  236. simplint-0.1.0/tasks/cargo_version.py +19 -0
  237. simplint-0.1.0/tasks/check_sdist.py +51 -0
  238. simplint-0.1.0/tasks/generate_changelog.py +48 -0
  239. simplint-0.1.0/tasks/generate_readme.py +107 -0
  240. simplint-0.1.0/tasks/python_versions.py +139 -0
  241. simplint-0.1.0/tasks/update_cargo_edit.py +123 -0
  242. simplint-0.1.0/tests/cli.rs +259 -0
  243. simplint-0.1.0/tests/tasks/test_assemble_release.py +82 -0
  244. simplint-0.1.0/tests/tasks/test_cargo_version.py +28 -0
  245. simplint-0.1.0/tests/tasks/test_check_sdist.py +40 -0
  246. simplint-0.1.0/tests/tasks/test_generate_changelog.py +40 -0
  247. simplint-0.1.0/tests/tasks/test_generate_readme.py +44 -0
  248. simplint-0.1.0/tests/tasks/test_python_versions.py +134 -0
  249. simplint-0.1.0/tests/tasks/test_update_cargo_edit.py +162 -0
  250. simplint-0.1.0/tests/wheel/test_cli.py +47 -0
  251. simplint-0.1.0/tox.toml +134 -0
  252. simplint-0.1.0/toxfile.py +29 -0
  253. simplint-0.1.0/uv.lock +2368 -0
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-10-30)
4
+
5
+ <a name="release-0-1-0"></a>
6
+
7
+ <a name="release-0-1-0-added"></a>
8
+
9
+ ### Added
10
+
11
+ - First release: 32 rules for the parts of the simp house style Ruff has no rule for, with safe and unsafe fixes and a
12
+ cross-module import index by Bernát Gábor.
@@ -0,0 +1,50 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Pledge
4
+
5
+ Contributors and maintainers commit to a harassment-free community without regard to age, body size, disability,
6
+ ethnicity, gender identity or expression, experience, nationality, appearance, race, religion, sexual identity, or
7
+ sexual orientation.
8
+
9
+ ## Standards
10
+
11
+ Expected conduct includes:
12
+
13
+ - using inclusive language;
14
+ - respecting different viewpoints and experiences;
15
+ - accepting constructive criticism;
16
+ - putting the community's interests first;
17
+ - showing empathy toward other community members.
18
+
19
+ Unacceptable conduct includes:
20
+
21
+ - sexualized language, imagery, attention, or advances;
22
+ - trolling, insults, derogatory comments, or personal and political attacks;
23
+ - public or private harassment;
24
+ - publishing another person's private information without permission;
25
+ - conduct that a professional setting would reject.
26
+
27
+ ## Maintainer responsibilities
28
+
29
+ Maintainers clarify these standards and respond to violations under this code. They may remove or reject comments,
30
+ commits, code, wiki edits, issues, or other contributions that violate this code. They may also ban contributors whose
31
+ conduct is threatening, offensive, or harmful.
32
+
33
+ ## Scope
34
+
35
+ This code applies in project spaces and when someone represents the project in public. Representation includes using a
36
+ project email address or social account and acting as an appointed representative at an event. Maintainers may define
37
+ other forms of representation.
38
+
39
+ ## Enforcement
40
+
41
+ Report abusive, harassing, or unacceptable conduct to gaborbernat@python.org. The project team will investigate and
42
+ respond according to the circumstances while protecting the reporter's identity.
43
+
44
+ Maintainers who fail to enforce this code in good faith may face consequences set by other project leaders.
45
+
46
+ ## Attribution
47
+
48
+ Adapted from [Contributor Covenant 1.4][version].
49
+
50
+ [version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
@@ -0,0 +1,117 @@
1
+ # Contributing to simplint
2
+
3
+ ## Repository layout
4
+
5
+ simplint is one Rust crate that builds the `simplint` binary. maturin packages that binary into a Python wheel, the way
6
+ Ruff ships, so the Python side holds only packaging, documentation and maintenance scripts:
7
+
8
+ - `src/` holds the linter. `src/rules/` has one module per rule family, and `src/rules/docs/` has one Markdown page per
9
+ rule, compiled into the binary.
10
+ - `resources/test/fixtures/` holds the Python files the rule tests lint.
11
+ - `tests/cli.rs` drives the binary end to end; `tests/wheel/` runs the installed wheel under each Python; `tests/tasks/`
12
+ covers the maintenance scripts in `tasks/`.
13
+ - `docs/` is the Sphinx site published on Read the Docs, and the source of the PyPI README.
14
+
15
+ ## Development commands
16
+
17
+ Add one nonempty fragment to `changelog.d/` for each user-facing change. Use a descriptive filename such as
18
+ `+narrow-patch-matching.bugfix.md`; release preparation links it to the squash-merged pull request. A numeric PR
19
+ filename also works. Put separate changes in separate files, including changes in different categories.
20
+
21
+ Choose the suffix for the effect on users: `feature` for a new rule or option, `change` for changed behavior, `bugfix`
22
+ for a correction, and `doc` for documentation. `security`, `performance`, `deprecation`, `removal`, and `packaging` are
23
+ available when those changes affect users. Use `breaking` for an incompatible change. The fragment text may use Markdown
24
+ links. Do not write credits in it: release preparation credits the pull request's commit authors and runs
25
+ `release-creator contributors` to add a New Contributors subsection. Documentation builds show pending fragments under
26
+ Draft on the changelog page.
27
+
28
+ Apply `skip news` when the change has no user-facing effect. Bot pull requests without a fragment receive it
29
+ automatically. Release preparation folds the fragments into [CHANGELOG.md](CHANGELOG.md), formats it with prek, commits
30
+ the new version, and pushes the tag. The tag starts the build and publish workflow, which creates a GitHub Release after
31
+ PyPI succeeds.
32
+
33
+ Use Cargo for Rust changes:
34
+
35
+ ```bash
36
+ cargo fmt
37
+ cargo clippy --all-targets --locked -- -D warnings
38
+ cargo test
39
+ ```
40
+
41
+ Test the built wheel and the repository tooling through tox:
42
+
43
+ ```bash
44
+ tox run -e 3.15
45
+ tox run -e type
46
+ tox run -e fix
47
+ ```
48
+
49
+ Choose an installed Python version if 3.15 is unavailable. Tox skips missing interpreters.
50
+
51
+ ## How a run works
52
+
53
+ `main.rs` walks the paths, finds each file's settings, and builds one import index for the whole run before linting any
54
+ file. Each file is parsed once; the rules then share that parse.
55
+
56
+ ```mermaid
57
+ flowchart LR
58
+ paths[paths] --> discover[discover files and settings]
59
+ discover --> index[project import index]
60
+ index --> lint[lint each file in parallel]
61
+ lint --> noqa[noqa filter]
62
+ noqa --> fix[apply fixes until stable]
63
+ fix --> report[report]
64
+ ```
65
+
66
+ - `Project` records which names each module imports from the others, every attribute name assigned anywhere, and every
67
+ base class name. Rules ask it before renaming or moving a name.
68
+ - `Checker` holds one file's parse, its lazily built `Semantic` model of module-level bindings and references, and the
69
+ diagnostics. A rule is a function that takes the `Checker` and reports.
70
+ - `Linter::fix` applies non-overlapping fixes, reparses, and repeats until no fix applies. A fix that does not parse, or
71
+ a loop that does not settle, aborts the file instead of writing it.
72
+
73
+ ## Adding a rule
74
+
75
+ 1. Add a line to the `rules!` table in `src/registry.rs`: variant, code, kebab-case name, one-line summary, fix
76
+ availability, and the checking function.
77
+ 1. Write the function in the matching `src/rules/` module. Report through `checker.report`, with a `Fix` marked safe
78
+ only when no program can observe the change.
79
+ 1. Add `src/rules/docs/<CODE>.md` with the What it does, Why is this bad?, Example and Fix safety sections.
80
+ 1. Add a fixture under `resources/test/fixtures/` and a `test_case` row in the module's tests.
81
+
82
+ ## Tests
83
+
84
+ Write behavior tests through the public entry points. Keep one assertion target per test, parameterize repeated cases,
85
+ and use fixtures for shared setup.
86
+
87
+ Rule tests render the diagnostics and the fully fixed file into an `insta` snapshot. Populate and review them with:
88
+
89
+ ```bash
90
+ cargo insta test --accept
91
+ cargo insta review
92
+ ```
93
+
94
+ The crate enforces 100% line coverage, with only the fix guards excluded:
95
+
96
+ ```bash
97
+ cargo llvm-cov --ignore-filename-regex 'guards\.rs' --fail-uncovered-lines 0 --show-missing-lines
98
+ ```
99
+
100
+ ## Documentation
101
+
102
+ Edit the files under `docs/`. Generate the published README from those sources:
103
+
104
+ ```bash
105
+ tox run -e readme
106
+ ```
107
+
108
+ Build and check links with the documentation environment:
109
+
110
+ ```bash
111
+ tox run -e docs
112
+ ```
113
+
114
+ ## Before committing
115
+
116
+ Run the checks for each changed layer. A rule change needs its snapshots reviewed, coverage, and the rule page updated.
117
+ A documentation change needs README generation and the docs build. Keep commits limited to one concern.