Replies: 1 comment 2 replies
-
Hey @mthuurne!
fields:
filename:
type: str
- docs: A relative filename (e.g. relative to the project root).
+ docs: The path to the file where the API object owning this location was loaded from. Docspec loaders
+ may not have an understanding of the source code root path without additional configuration, thus it
+ is acceptable to produce absolute system-specific paths by default. Loaders should however support a
+ configuration option to produce POSIX-compatible relative paths for interoperability.
|
Beta Was this translation helpful? Give feedback.
-
The
Location.filename
property contains a relative file path, but what is the path separator? I think it would be good to specify that slashes must be used. Should the path start with a separator or not?Many Python projects are now putting their sources in a
src/
directory. Shouldsrc/
be part offilename
or not? The spec states "relative to the root of a project or source control repository", but those two options can result in different paths. If different tools make different assumptions here, it will hurt interoperability.For
lineno
, is the first line of a file considered line 0 or line 1?For
endlineno
, is that an inclusive or exclusive bound? I assume inclusive, but it doesn't hurt to be explicit.Are tools encouraged to fill in
endlineno
only for multi-line locations, or also for single line locations? A consumer of the data might want to handle known single-line locations differently from locations of which the end point is unknown, so there could be an advantage to filling inendlineno
for single-line locations.Beta Was this translation helpful? Give feedback.
All reactions