.pre-commit-config.yaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. default_language_version:
  2. python: python3
  3. exclude: ^(doc/_static/.*|doc/_themes/.*)$
  4. repos:
  5. - repo: https://github.com/s0undt3ch/salt-rewrite
  6. rev: 0.6.0
  7. hooks:
  8. - id: salt-rewrite
  9. args:
  10. - --exclude-fix=fix_asserts
  11. exclude: ^templates/.*$
  12. - repo: https://github.com/saltstack/pip-tools-compile-impersonate
  13. rev: master
  14. hooks:
  15. - id: pip-tools-compile
  16. alias: compile-linux-py3.5-zmq-requirements
  17. name: Linux Py3.5 ZeroMQ Requirements
  18. files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
  19. exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
  20. args:
  21. - -v
  22. - --py-version=3.5
  23. - --platform=linux
  24. - --include=requirements/base.txt
  25. - --include=requirements/zeromq.txt
  26. - --include=requirements/pytest.txt
  27. - id: pip-tools-compile
  28. alias: compile-darwin-py3.5-zmq-requirements
  29. name: Darwin Py3.5 ZeroMQ Requirements
  30. files: ^(pkg/osx/(req|req_ext|req_pyobjc)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
  31. args:
  32. - -v
  33. - --py-version=3.5
  34. - --platform=darwin
  35. - --include=pkg/osx/req.txt
  36. - --include=pkg/osx/req_ext.txt
  37. - --include=pkg/osx/req_pyobjc.txt
  38. - --include=requirements/base.txt
  39. - --include=requirements/zeromq.txt
  40. - --include=requirements/pytest.txt
  41. - --passthrough-line-from-input=^pyobjc(.*)$
  42. - id: pip-tools-compile
  43. alias: compile-windows-py3.5-zmq-requirements
  44. name: Windows Py3.5 ZeroMQ Requirements
  45. files: ^(pkg/windows/(req|req_win)\.txt|requirements/((base|zeromq|pytest)\.txt|static/windows\.in))$
  46. args:
  47. - -v
  48. - --py-version=3.5
  49. - --platform=windows
  50. - --include=pkg/windows/req.txt
  51. - --include=pkg/windows/req_win.txt
  52. - --include=requirements/base.txt
  53. - --include=requirements/zeromq.txt
  54. - --include=requirements/pytest.txt
  55. - id: pip-tools-compile
  56. alias: compile-cloud-py3.5-requirements
  57. name: Cloud Py3.5 Requirements
  58. files: ^requirements/(static/cloud\.in)$
  59. args:
  60. - -v
  61. - --py-version=3.5
  62. - id: pip-tools-compile
  63. alias: compile-doc-requirements
  64. name: Docs Py3.5 Requirements
  65. files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
  66. args:
  67. - -v
  68. - --py-version=3.5
  69. - --platform=linux
  70. - id: pip-tools-compile
  71. alias: compile-changelog-requirements
  72. name: Changelog Py3.5 Requirements
  73. files: ^requirements/static/changelog\.in$
  74. args:
  75. - -v
  76. - --py-version=3.5
  77. - --platform=linux
  78. - id: pip-tools-compile
  79. alias: compile-linux-crypto-py3.5-requirements
  80. name: Linux Py3.5 Crypto Requirements
  81. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  82. args:
  83. - -v
  84. - --py-version=3.5
  85. - --platform=linux
  86. - --out-prefix=linux
  87. - id: pip-tools-compile
  88. alias: compile-darwin-crypto-py3.5-requirements
  89. name: Darwin Py3.5 Crypto Requirements
  90. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  91. args:
  92. - -v
  93. - --py-version=3.5
  94. - --platform=darwin
  95. - --out-prefix=darwin
  96. - id: pip-tools-compile
  97. alias: compile-windows-crypto-py3.5-requirements
  98. name: Windows Py3.5 Crypto Requirements
  99. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  100. args:
  101. - -v
  102. - --py-version=3.5
  103. - --platform=windows
  104. - --out-prefix=windows
  105. - id: pip-tools-compile
  106. alias: compile-lint-py3.5-requirements
  107. name: Lint Py3.5 Requirements
  108. files: ^requirements/static/lint\.in$
  109. args:
  110. - -v
  111. - --py-version=3.5
  112. - --platform=linux
  113. - id: pip-tools-compile
  114. alias: compile-linux-py3.6-zmq-requirements
  115. name: Linux Py3.6 ZeroMQ Requirements
  116. files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
  117. exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
  118. args:
  119. - -v
  120. - --py-version=3.6
  121. - --platform=linux
  122. - --include=requirements/base.txt
  123. - --include=requirements/zeromq.txt
  124. - --include=requirements/pytest.txt
  125. - id: pip-tools-compile
  126. alias: compile-darwin-py3.6-zmq-requirements
  127. name: Darwin Py3.6 ZeroMQ Requirements
  128. files: ^(pkg/osx/(req|req_ext|req_pyobjc)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
  129. args:
  130. - -v
  131. - --py-version=3.6
  132. - --platform=darwin
  133. - --include=pkg/osx/req.txt
  134. - --include=pkg/osx/req_ext.txt
  135. - --include=pkg/osx/req_pyobjc.txt
  136. - --include=requirements/base.txt
  137. - --include=requirements/zeromq.txt
  138. - --include=requirements/pytest.txt
  139. - --passthrough-line-from-input=^pyobjc(.*)$
  140. - id: pip-tools-compile
  141. alias: compile-windows-py3.6-zmq-requirements
  142. name: Windows Py3.6 ZeroMQ Requirements
  143. files: ^(pkg/windows/(req|req_win)\.txt|requirements/((base|zeromq|pytest)\.txt|static/windows\.in))$
  144. args:
  145. - -v
  146. - --py-version=3.6
  147. - --platform=windows
  148. - --include=pkg/windows/req.txt
  149. - --include=pkg/windows/req_win.txt
  150. - --include=requirements/base.txt
  151. - --include=requirements/zeromq.txt
  152. - --include=requirements/pytest.txt
  153. - id: pip-tools-compile
  154. alias: compile-cloud-py3.6-requirements
  155. name: Cloud Py3.6 Requirements
  156. files: ^requirements/(static/cloud\.in)$
  157. args:
  158. - -v
  159. - --py-version=3.6
  160. - id: pip-tools-compile
  161. alias: compile-doc-requirements
  162. name: Docs Py3.6 Requirements
  163. files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
  164. args:
  165. - -v
  166. - --py-version=3.6
  167. - --platform=linux
  168. - id: pip-tools-compile
  169. alias: compile-changelog-requirements
  170. name: Changelog Py3.6 Requirements
  171. files: ^requirements/static/changelog\.in$
  172. args:
  173. - -v
  174. - --py-version=3.6
  175. - --platform=linux
  176. - id: pip-tools-compile
  177. alias: compile-linux-crypto-py3.6-requirements
  178. name: Linux Py3.6 Crypto Requirements
  179. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  180. args:
  181. - -v
  182. - --py-version=3.6
  183. - --platform=linux
  184. - --out-prefix=linux
  185. - id: pip-tools-compile
  186. alias: compile-darwin-crypto-py3.6-requirements
  187. name: Darwin Py3.6 Crypto Requirements
  188. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  189. args:
  190. - -v
  191. - --py-version=3.6
  192. - --platform=darwin
  193. - --out-prefix=darwin
  194. - id: pip-tools-compile
  195. alias: compile-windows-crypto-py3.6-requirements
  196. name: Windows Py3.6 Crypto Requirements
  197. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  198. args:
  199. - -v
  200. - --py-version=3.6
  201. - --platform=windows
  202. - --out-prefix=windows
  203. - id: pip-tools-compile
  204. alias: compile-lint-py3.6-requirements
  205. name: Lint Py3.6 Requirements
  206. files: ^requirements/static/lint\.in$
  207. args:
  208. - -v
  209. - --py-version=3.6
  210. - --platform=linux
  211. - id: pip-tools-compile
  212. alias: compile-linux-py3.7-zmq-requirements
  213. name: Linux Py3.7 ZeroMQ Requirements
  214. files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
  215. exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
  216. args:
  217. - -v
  218. - --py-version=3.7
  219. - --platform=linux
  220. - --include=requirements/base.txt
  221. - --include=requirements/zeromq.txt
  222. - --include=requirements/pytest.txt
  223. - id: pip-tools-compile
  224. alias: compile-darwin-py3.7-zmq-requirements
  225. name: Darwin Py3.7 ZeroMQ Requirements
  226. files: ^(pkg/osx/(req|req_ext|req_pyobjc)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
  227. args:
  228. - -v
  229. - --py-version=3.7
  230. - --platform=darwin
  231. - --include=pkg/osx/req.txt
  232. - --include=pkg/osx/req_ext.txt
  233. - --include=pkg/osx/req_pyobjc.txt
  234. - --include=requirements/base.txt
  235. - --include=requirements/zeromq.txt
  236. - --include=requirements/pytest.txt
  237. - --passthrough-line-from-input=^pyobjc(.*)$
  238. - id: pip-tools-compile
  239. alias: compile-windows-py3.7-zmq-requirements
  240. name: Windows Py3.7 ZeroMQ Requirements
  241. files: ^(pkg/windows/(req|req_win)\.txt|requirements/((base|zeromq|pytest)\.txt|static/windows\.in))$
  242. args:
  243. - -v
  244. - --py-version=3.7
  245. - --platform=windows
  246. - --include=pkg/windows/req.txt
  247. - --include=pkg/windows/req_win.txt
  248. - --include=requirements/base.txt
  249. - --include=requirements/zeromq.txt
  250. - --include=requirements/pytest.txt
  251. - id: pip-tools-compile
  252. alias: compile-cloud-py3.7-requirements
  253. name: Cloud Py3.7 Requirements
  254. files: ^requirements/(static/cloud\.in)$
  255. args:
  256. - -v
  257. - --py-version=3.7
  258. - id: pip-tools-compile
  259. alias: compile-doc-requirements
  260. name: Docs Py3.7 Requirements
  261. files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
  262. args:
  263. - -v
  264. - --py-version=3.7
  265. - --platform=linux
  266. - id: pip-tools-compile
  267. alias: compile-changelog-requirements
  268. name: Changelog Py3.7 Requirements
  269. files: ^requirements/static/changelog\.in$
  270. args:
  271. - -v
  272. - --py-version=3.7
  273. - --platform=linux
  274. - id: pip-tools-compile
  275. alias: compile-linux-crypto-py3.7-requirements
  276. name: Linux Py3.7 Crypto Requirements
  277. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  278. args:
  279. - -v
  280. - --py-version=3.7
  281. - --platform=linux
  282. - --out-prefix=linux
  283. - id: pip-tools-compile
  284. alias: compile-darwin-crypto-py3.7-requirements
  285. name: Darwin Py3.7 Crypto Requirements
  286. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  287. args:
  288. - -v
  289. - --py-version=3.7
  290. - --platform=darwin
  291. - --out-prefix=darwin
  292. - id: pip-tools-compile
  293. alias: compile-windows-crypto-py3.7-requirements
  294. name: Windows Py3.7 Crypto Requirements
  295. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  296. args:
  297. - -v
  298. - --py-version=3.7
  299. - --platform=windows
  300. - --out-prefix=windows
  301. - id: pip-tools-compile
  302. alias: compile-lint-py3.7-requirements
  303. name: Lint Py3.7 Requirements
  304. files: ^requirements/static/lint\.in$
  305. args:
  306. - -v
  307. - --py-version=3.7
  308. - --platform=linux
  309. - id: pip-tools-compile
  310. alias: compile-linux-py3.8-zmq-requirements
  311. name: Linux Py3.8 ZeroMQ Requirements
  312. files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
  313. exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
  314. args:
  315. - -v
  316. - --py-version=3.8
  317. - --platform=linux
  318. - --include=requirements/base.txt
  319. - --include=requirements/zeromq.txt
  320. - --include=requirements/pytest.txt
  321. - id: pip-tools-compile
  322. alias: compile-darwin-py3.8-zmq-requirements
  323. name: Darwin Py3.8 ZeroMQ Requirements
  324. files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
  325. args:
  326. - -v
  327. - --py-version=3.8
  328. - --platform=darwin
  329. - --include=pkg/osx/req.txt
  330. - --include=pkg/osx/req_ext.txt
  331. - --include=requirements/base.txt
  332. - --include=requirements/zeromq.txt
  333. - --include=requirements/pytest.txt
  334. - --passthrough-line-from-input=^pyobjc(.*)$
  335. # Commented out since pywin32 and pymssql do not have packages or support for Py >= 3.8
  336. # - id: pip-tools-compile
  337. # alias: compile-windows-py3.8-zmq-requirements
  338. # name: Windows Py3.8 ZeroMQ Requirements
  339. # files: ^(pkg/windows/(req|req_win)\.txt|requirements/((base|zeromq|pytest)\.txt|static/windows\.in))$
  340. # args:
  341. # - -v
  342. # - --py-version=3.8
  343. # - --platform=windows
  344. # - --include=pkg/windows/req.txt
  345. # - --include=pkg/windows/req_win.txt
  346. # - --include=requirements/base.txt
  347. # - --include=requirements/zeromq.txt
  348. # - --include=requirements/pytest.txt
  349. - id: pip-tools-compile
  350. alias: compile-cloud-py3.8-requirements
  351. name: Cloud Py3.8 Requirements
  352. files: ^requirements/(static/cloud\.in)$
  353. args:
  354. - -v
  355. - --py-version=3.8
  356. - id: pip-tools-compile
  357. alias: compile-doc-requirements
  358. name: Docs Py3.8 Requirements
  359. files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
  360. args:
  361. - -v
  362. - --py-version=3.8
  363. - --platform=linux
  364. - id: pip-tools-compile
  365. alias: compile-linux-crypto-py3.8-requirements
  366. name: Linux Py3.8 Crypto Requirements
  367. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  368. args:
  369. - -v
  370. - --py-version=3.8
  371. - --platform=linux
  372. - --out-prefix=linux
  373. - id: pip-tools-compile
  374. alias: compile-darwin-crypto-py3.8-requirements
  375. name: Darwin Py3.8 Crypto Requirements
  376. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  377. args:
  378. - -v
  379. - --py-version=3.8
  380. - --platform=darwin
  381. - --out-prefix=darwin
  382. # Commented out since pywin32 and pymssql do not have packages or support for Py >= 3.8
  383. # - id: pip-tools-compile
  384. # alias: compile-windows-crypto-py3.8-requirements
  385. # name: Windows Py3.8 Crypto Requirements
  386. # files: ^requirements/(crypto\.txt|static/crypto\.in)$
  387. # args:
  388. # - -v
  389. # - --py-version=3.8
  390. # - --platform=windows
  391. # - --out-prefix=windows
  392. - id: pip-tools-compile
  393. alias: compile-lint-py3.8-requirements
  394. name: Lint Py3.8 Requirements
  395. files: ^requirements/static/lint\.in$
  396. args:
  397. - -v
  398. - --py-version=3.8
  399. - --platform=linux
  400. - id: pip-tools-compile
  401. alias: compile-linux-py3.9-zmq-requirements
  402. name: Linux Py3.9 ZeroMQ Requirements
  403. files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
  404. exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
  405. args:
  406. - -v
  407. - --py-version=3.9
  408. - --platform=linux
  409. - --include=requirements/base.txt
  410. - --include=requirements/zeromq.txt
  411. - --include=requirements/pytest.txt
  412. - id: pip-tools-compile
  413. alias: compile-darwin-py3.9-zmq-requirements
  414. name: Darwin Py3.9 ZeroMQ Requirements
  415. files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
  416. args:
  417. - -v
  418. - --py-version=3.9
  419. - --platform=darwin
  420. - --include=pkg/osx/req.txt
  421. - --include=pkg/osx/req_ext.txt
  422. - --include=requirements/base.txt
  423. - --include=requirements/zeromq.txt
  424. - --include=requirements/pytest.txt
  425. - --passthrough-line-from-input=^pyobjc(.*)$
  426. # Commented out since pywin32 and pymssql do not have packages or support for Py >= 3.8
  427. # - id: pip-tools-compile
  428. # alias: compile-windows-py3.9-zmq-requirements
  429. # name: Windows Py3.9 ZeroMQ Requirements
  430. # files: ^(pkg/windows/(req|req_win)\.txt|requirements/((base|zeromq|pytest)\.txt|static/windows\.in))$
  431. # args:
  432. # - -v
  433. # - --py-version=3.9
  434. # - --platform=windows
  435. # - --include=pkg/windows/req.txt
  436. # - --include=pkg/windows/req_win.txt
  437. # - --include=requirements/base.txt
  438. # - --include=requirements/zeromq.txt
  439. # - --include=requirements/pytest.txt
  440. - id: pip-tools-compile
  441. alias: compile-cloud-py3.9-requirements
  442. name: Cloud Py3.9 Requirements
  443. files: ^requirements/(static/cloud\.in)$
  444. args:
  445. - -v
  446. - --py-version=3.9
  447. - id: pip-tools-compile
  448. alias: compile-doc-requirements
  449. name: Docs Py3.9 Requirements
  450. files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
  451. args:
  452. - -v
  453. - --py-version=3.9
  454. - --platform=linux
  455. - id: pip-tools-compile
  456. alias: compile-linux-crypto-py3.9-requirements
  457. name: Linux Py3.9 Crypto Requirements
  458. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  459. args:
  460. - -v
  461. - --py-version=3.9
  462. - --platform=linux
  463. - --out-prefix=linux
  464. - id: pip-tools-compile
  465. alias: compile-darwin-crypto-py3.9-requirements
  466. name: Darwin Py3.9 Crypto Requirements
  467. files: ^requirements/(crypto\.txt|static/crypto\.in)$
  468. args:
  469. - -v
  470. - --py-version=3.9
  471. - --platform=darwin
  472. - --out-prefix=darwin
  473. # Commented out since pywin32 and pymssql do not have packages or support for Py >= 3.8
  474. # - id: pip-tools-compile
  475. # alias: compile-windows-crypto-py3.9-requirements
  476. # name: Windows Py3.9 Crypto Requirements
  477. # files: ^requirements/(crypto\.txt|static/crypto\.in)$
  478. # args:
  479. # - -v
  480. # - --py-version=3.9
  481. # - --platform=windows
  482. # - --out-prefix=windows
  483. - id: pip-tools-compile
  484. alias: compile-lint-py3.9-requirements
  485. name: Lint Py3.9 Requirements
  486. files: ^requirements/static/lint\.in$
  487. args:
  488. - -v
  489. - --py-version=3.9
  490. - --platform=linux
  491. - repo: https://github.com/timothycrosley/isort
  492. rev: "1e78a9acf3110e1f9721feb591f89a451fc9876a"
  493. hooks:
  494. - id: isort
  495. additional_dependencies: ['toml']
  496. # This tells pre-commit not to pass files to isort.
  497. # This should be kept in sync with pyproject.toml
  498. exclude: >
  499. (?x)^(
  500. templates/.*|
  501. salt/ext/.*|
  502. tests/kitchen/.*
  503. )$
  504. - repo: https://github.com/psf/black
  505. rev: stable
  506. hooks:
  507. - id: black
  508. # This tells pre-commit not to pass files to black.
  509. # This should be kept in sync with pyproject.toml
  510. exclude: >
  511. (?x)^(
  512. templates/.*|
  513. salt/ext/.*|
  514. tests/kitchen/.*
  515. )$
  516. - repo: https://github.com/saltstack/salt-nox-pre-commit
  517. rev: master
  518. hooks:
  519. - id: nox-py2
  520. alias: lint-salt
  521. name: Lint Salt
  522. files: ^((setup|noxfile)|salt/.*)\.py$
  523. args:
  524. - -e
  525. - lint-salt-pre-commit
  526. - --
  527. - repo: https://github.com/saltstack/salt-nox-pre-commit
  528. rev: master
  529. hooks:
  530. - id: nox-py2
  531. alias: lint-tests
  532. name: Lint Tests
  533. files: ^tests/.*\.py$
  534. args:
  535. - -e
  536. - lint-tests-pre-commit
  537. - --