|
| 1 | +# Note that for values that are regexes, how YAML interprets backslashes and other |
| 2 | +# special characters matters. For example, an unquoted string is interpreted as a raw |
| 3 | +# string with no escape characters (so it's particularly useful for expressing regexes). |
| 4 | +# Adding quotes around these may change their meaning, so don't do so without thought. |
| 5 | + |
| 6 | +required_matches: |
| 7 | + # If we decide to enable this, remove the st2flake8 |
| 8 | + #python_source: |
| 9 | + # - python_header |
| 10 | + #build_files: |
| 11 | + # - python_header |
| 12 | + |
| 13 | + # TODO: In the future pants should get `visibility` and possibly other |
| 14 | + # features to restrict imports for dependees or dependencies. |
| 15 | + # - https://github.com/pantsbuild/pants/issues/13393 |
| 16 | + # - https://github.com/pantsbuild/pants/pull/15803 |
| 17 | + # - https://github.com/pantsbuild/pants/pull/15836 |
| 18 | + # When that happens, we can add that target metadata, |
| 19 | + # and remove these regex based dependency checks. |
| 20 | + |
| 21 | + # st2client-dependencies-check |
| 22 | + st2client: |
| 23 | + - must_not_import_st2common |
| 24 | + |
| 25 | + # st2common-circular-dependencies-check |
| 26 | + st2common: |
| 27 | + - must_not_import_st2reactor |
| 28 | + - must_not_import_st2api |
| 29 | + - must_not_import_st2auth |
| 30 | + #- must_not_import_st2actions |
| 31 | + #- must_not_import_st2stream |
| 32 | + st2common_except_services_inquiry: |
| 33 | + # The makefile excluded: runnersregistrar.py, compat.py, inquiry.py |
| 34 | + # runnersregistrar does not have an st2actions ref since 2016. |
| 35 | + # compat.py st2actions function was added and removed in 2017. |
| 36 | + # services/inquiry.py still imports st2actions. |
| 37 | + - must_not_import_st2actions |
| 38 | + st2common_except_router: |
| 39 | + # The makefile excluded router.py from st2stream check. |
| 40 | + # In router.py, "st2stream" is a string, not an import. |
| 41 | + - must_not_import_st2stream |
| 42 | + |
| 43 | +path_patterns: |
| 44 | + #- name: python_source |
| 45 | + # pattern: (?<!__init__)\.py$ |
| 46 | + #- name: build_files |
| 47 | + # pattern: /BUILD$ |
| 48 | + |
| 49 | + - name: st2client |
| 50 | + pattern: st2client/st2client/.*\.py$ |
| 51 | + - name: st2common |
| 52 | + pattern: st2common/st2common/.*\.py$ |
| 53 | + |
| 54 | + - name: st2common_except_services_inquiry |
| 55 | + pattern: st2common/st2common/(?!services/inquiry\.py).*\.py$ |
| 56 | + |
| 57 | + - name: st2common_except_router |
| 58 | + pattern: st2common/st2common/(?!router\.py).*\.py$ |
| 59 | + |
| 60 | +content_patterns: |
| 61 | + #- name: python_header |
| 62 | + # pattern: |+ |
| 63 | + # ^(?:#\!\/usr\/bin\/env python3 |
| 64 | + # )?# Copyright 20\d\d The StackStorm Authors. |
| 65 | + # (?:# Copyright 20\d\d .* |
| 66 | + # )*# |
| 67 | + # # Licensed under the Apache License, Version 2.0 (the "License"); |
| 68 | + # # you may not use this file except in compliance with the License. |
| 69 | + # # You may obtain a copy of the License at |
| 70 | + # # |
| 71 | + # # http://www.apache.org/licenses/LICENSE-2.0 |
| 72 | + # # |
| 73 | + # # Unless required by applicable law or agreed to in writing, software |
| 74 | + # # distributed under the License is distributed on an "AS IS" BASIS, |
| 75 | + # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 76 | + # # See the License for the specific language governing permissions and |
| 77 | + # # limitations under the License. |
| 78 | + |
| 79 | + - name: must_not_import_st2common |
| 80 | + pattern: st2common |
| 81 | + inverted: true |
| 82 | + |
| 83 | + - name: must_not_import_st2reactor |
| 84 | + pattern: st2reactor |
| 85 | + inverted: true |
| 86 | + |
| 87 | + - name: must_not_import_st2actions |
| 88 | + pattern: st2actions |
| 89 | + inverted: true |
| 90 | + |
| 91 | + - name: must_not_import_st2api |
| 92 | + pattern: st2api |
| 93 | + inverted: true |
| 94 | + |
| 95 | + - name: must_not_import_st2auth |
| 96 | + pattern: st2auth |
| 97 | + inverted: true |
| 98 | + |
| 99 | + - name: must_not_import_st2stream |
| 100 | + pattern: st2stream |
| 101 | + inverted: true |
0 commit comments