1
0

.pre-commit-config.yaml 20 KB

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