Skip to content

Commit 8914db1

Browse files
committed
update
1 parent fecb2a9 commit 8914db1

File tree

4 files changed

+1
-46
lines changed

4 files changed

+1
-46
lines changed

gazelle/python/file_parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func (p *FileParser) parseImportStatements(node *sitter.Node) bool {
165165
}
166166
} else if node.Type() == sitterNodeTypeImportFromStatement {
167167
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.
169169
// If the import is from a different relative package i.e. from .package1 import foo, we need to add it to the modules.
170170
if from == "." {
171171
return true

gazelle/python/testdata/resolve_deps_relative_imports/package2/library/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
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-
161
def add(a, b):
172
return a + b
183

gazelle/python/testdata/resolve_deps_relative_imports/package2/module3.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
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-
161
from .library import function5
172

183

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,2 @@
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-
161
def function4():
172
return "function4"

0 commit comments

Comments
 (0)