Reduce Python API surface area to what is necessary for kcl.py (#4637)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2024-12-03 17:34:58 +13:00
committed by GitHub
parent 68ae7e98f9
commit 5ae1aecd74
6 changed files with 8 additions and 17 deletions

View File

@ -30,16 +30,16 @@ where
#[serde(rename_all = "camelCase")]
pub struct Discovered {
/// Zoo Lint Finding information.
pub finding: Finding,
pub(super) finding: Finding,
/// Further information about the specific finding.
pub description: String,
pub(super) description: String,
/// Source code location.
pub pos: SourceRange,
pub(super) pos: SourceRange,
/// Is this discovered issue overridden by the programmer?
pub overridden: bool,
pub(super) overridden: bool,
}
#[cfg(feature = "pyo3")]
@ -56,8 +56,8 @@ impl Discovered {
}
#[getter]
pub fn pos(&self) -> SourceRange {
self.pos
pub fn pos(&self) -> (usize, usize) {
(self.pos.start(), self.pos.end())
}
#[getter]