File tree 4 files changed +1
-46
lines changed
testdata/resolve_deps_relative_imports/package2 4 files changed +1
-46
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ func (p *FileParser) parseImportStatements(node *sitter.Node) bool {
165
165
}
166
166
} else if node .Type () == sitterNodeTypeImportFromStatement {
167
167
from := node .Child (1 ).Content (p .code )
168
- // If the import is from the current package, we don't need to add it to the modules.
168
+ // If the import is from the current package, we don't need to add it to the modules i.e. from . import Class1 .
169
169
// If the import is from a different relative package i.e. from .package1 import foo, we need to add it to the modules.
170
170
if from == "." {
171
171
return true
Original file line number Diff line number Diff line change 1
- # Copyright 2023 The Bazel Authors. All rights reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
1
def add (a , b ):
17
2
return a + b
18
3
Original file line number Diff line number Diff line change 1
- # Copyright 2023 The Bazel Authors. All rights reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
1
from .library import function5
17
2
18
3
Original file line number Diff line number Diff line change 1
- # Copyright 2023 The Bazel Authors. All rights reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
1
def function4 ():
17
2
return "function4"
You can’t perform that action at this time.
0 commit comments