Skip to content

Conversation

danparizher
Copy link
Contributor

Summary

Fixes #18959

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+8 -18 violations, +0 -0 fixes in 3 projects; 52 projects unchanged)

apache/superset (+0 -4 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview --select ALL

- superset/utils/date_parser.py:173:5: DOC502 Raised exceptions are not explicitly raised: `Relation to `time_range_lookup``, `- Example`
- superset/utils/date_parser.py:203:5: DOC502 Raised exceptions are not explicitly raised: `Relation to `time_range_lookup``, `- Example`
- superset/utils/date_parser.py:234:5: DOC502 Raised exceptions are not explicitly raised: `Relation to `time_range_lookup``, `- Example`
- superset/utils/date_parser.py:279:5: DOC502 Raised exceptions are not explicitly raised: `Relation to `time_range_lookup``, `- Example`

langchain-ai/langchain (+5 -5 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview

+ libs/langchain/langchain/chat_models/base.py:81:5: DOC502 Raised exceptions are not explicitly raised: `ValueError`, `ImportError`
- libs/langchain/langchain/chat_models/base.py:81:5: DOC502 Raised exceptions are not explicitly raised: `ValueError`, `ImportError`, `. dropdown`, ``, `. code-block`, `o3_mini = init_chat_model("openai`, `"anthropic`, `"google_vertexai`, `. dropdown`, `. code-block`, `"what's your name", config={"configurable"`, `config={"configurable"`, `. dropdown`, `. code-block`, `"openai`, `"configurable"`, `"foo_model"`, `"foo_temperature"`, `. dropdown`, `. code-block`, `class GetWeather(BaseModel)`, `location`, `class GetPopulation(BaseModel)`, `location`, `"Which city is hotter today and which is bigger`, `"Which city is hotter today and which is bigger`, `config={"configurable"`, `. versionadded`, `. versionchanged`, `. versionchanged`, `. versionchanged`, `. versionchanged`
+ libs/langchain/langchain/embeddings/base.py:133:5: DOC502 Raised exception is not explicitly raised: `ImportError`
- libs/langchain/langchain/embeddings/base.py:133:5: DOC502 Raised exceptions are not explicitly raised: `ImportError`, `. dropdown`, ``, `. code-block`, `model = init_embeddings("openai`, `model = init_embeddings("openai`, `. versionadded`
+ libs/langchain_v1/langchain/agents/react_agent.py:304:9: DOC502 Raised exception is not explicitly raised: `MultipleStructuredOutputsError`
- libs/langchain_v1/langchain/agents/react_agent.py:304:9: DOC502 Raised exceptions are not explicitly raised: `MultipleStructuredOutputsError`, `StructuredOutputParsingError`
+ libs/langchain_v1/langchain/chat_models/base.py:74:5: DOC502 Raised exceptions are not explicitly raised: `ValueError`, `ImportError`
- libs/langchain_v1/langchain/chat_models/base.py:74:5: DOC502 Raised exceptions are not explicitly raised: `ValueError`, `ImportError`, `. dropdown`, ``, `. code-block`, `o3_mini = init_chat_model("openai`, `claude_sonnet = init_chat_model("anthropic`, `gemini_2_flash = init_chat_model("google_vertexai`, `. dropdown`, `. code-block`, `"what's your name", config={"configurable"`, `"what's your name", config={"configurable"`, `. dropdown`, `. code-block`, `"openai`, `"configurable"`, `"foo_model"`, `"foo_temperature"`, `. dropdown`, `. code-block`, `class GetWeather(BaseModel)`, `location`, `class GetPopulation(BaseModel)`, `location`, `"Which city is hotter today and which is bigger`, `"Which city is hotter today and which is bigger`, `config={"configurable"`, `. versionadded`, `. versionchanged`, `. versionchanged`, `. versionchanged`, `. versionchanged`
+ libs/langchain_v1/langchain/embeddings/base.py:130:5: DOC502 Raised exception is not explicitly raised: `ImportError`
- libs/langchain_v1/langchain/embeddings/base.py:130:5: DOC502 Raised exceptions are not explicitly raised: `ImportError`, `. dropdown`, ``, `. code-block`, `model = init_embeddings("openai`, `model = init_embeddings("openai`, `. versionadded`

reflex-dev/reflex (+3 -9 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview

- reflex/compiler/compiler.py:716:5: DOC502 Raised exception is not explicitly raised: `# noqa`
+ reflex/components/core/foreach.py:48:9: DOC502 Raised exception is not explicitly raised: `UntypedVarError`
- reflex/components/core/foreach.py:48:9: DOC502 Raised exceptions are not explicitly raised: `UntypedVarError`, `# noqa`, `# noqa`
+ reflex/event.py:1437:5: DOC502 Raised exception is not explicitly raised: `EventHandlerArgTypeMismatchError`
- reflex/event.py:1437:5: DOC502 Raised exceptions are not explicitly raised: `EventHandlerArgTypeMismatchError`, `# noqa`, `# noqa`
+ reflex/state.py:2294:9: DOC502 Raised exception is not explicitly raised: `StateSerializationError`
- reflex/state.py:2294:9: DOC502 Raised exceptions are not explicitly raised: `StateSerializationError`, `# noqa`, `# noqa`
- reflex/vars/base.py:1232:13: DOC502 Raised exception is not explicitly raised: `# noqa`
- reflex/vars/base.py:1252:13: DOC502 Raised exception is not explicitly raised: `# noqa`
- reflex/vars/base.py:1285:13: DOC502 Raised exception is not explicitly raised: `# noqa`
- reflex/vars/base.py:1299:13: DOC502 Raised exception is not explicitly raised: `# noqa`
- reflex/vars/base.py:1310:13: DOC502 Raised exception is not explicitly raised: `# noqa`

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
DOC502 26 8 18 0 0

@danparizher
Copy link
Contributor Author

Note on ruff-ecosystem results: a net decrease in violations overall.

  • Instances where a “removal/addition” pair appears at the same location.
    • Those paired changes indicate message normalization rather than behavioral regression—the false positives are being eliminated where Sphinx directives follow a Raises section
  • Remaining diagnostics have cleaner messages without stray directive/markup fragments.

Net effect is reduced noise and improved precision

@MichaReiser MichaReiser requested a review from ntBre October 12, 2025 06:31
@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Oct 12, 2025
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I had an idea for a possibly simpler implementation more similar to the numpy version. Let me know what you think. We should keep a close eye on the ecosystem results to make sure they are still improved.

This new result actually looks incorrect to me:

Maybe my suggestion will help with that too.

};
let entry = potential[..colon_idx].trim();
entries.push(QualifiedName::user_defined(entry));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about something more like this for this function?

fn parse_entries_google(content: &str) -> Vec<QualifiedName<'_>> {
    let mut entries: Vec<QualifiedName> = Vec::new();
    let mut lines = content.lines().peekable();
    let Some(first) = lines.peek() else {
        return entries;
    };
    let indentation = &first[..first.len() - first.trim_start().len()];
    for potential in lines {
        if let Some(entry) = potential.strip_prefix(indentation) {
            if let Some(first_char) = entry.chars().next() {
                if !first_char.is_whitespace() {
                    if let Some(colon_idx) = entry.find(':') {
                        let entry = entry[..colon_idx].trim();
                        if !entry.is_empty() {
                            entries.push(QualifiedName::user_defined(entry));
                        }
                    }
                }
            }
        }
    }
    entries
}

This is closer to the parse_entries_numpy down below and seems to work on the new test case when I tried it locally.

@ntBre ntBre added docstring Related to docstring linting or formatting preview Related to preview mode features labels Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docstring Related to docstring linting or formatting preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC502: False positive if following text contains a colon

3 participants