Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: detect piped union #5918

Merged

Conversation

devinrsmith
Copy link
Member

@devinrsmith devinrsmith commented Aug 7, 2024

This allows vermin to correctly warn us if we are using the piped union syntax. Useful to prevent issues like #5912 in the future. In addition, self-documenting fstrings will be reported. Both of these features are labelled as "unstable"; if vermin ever produces a false positive, we can re-consider the inclusion of these features.

For example, it would have produced the following error:

Detecting python files..
Analyzing 247 files using 24 processes..
!2, 3.10     /home/devin/dev/deephaven/deephaven-core/py/server/deephaven/_table_reader.py
  union types as `X | Y` require !2, 3.10

Minimum required versions: 3.10
Incompatible versions:     2
Target versions not met:   3.8

Here is the documentation for these feature flags:

  [--feature <name>] ...
        Some features are disabled by default due to being unstable:
          fstring-self-doc - [Unstable] Detect self-documenting fstrings. Can in
                             some cases wrongly report fstrings as self-documenting.
          union-types      - [Unstable] Detect union types `X | Y`. Can in some cases
                             wrongly report union types due to having to employ heuristics.

This allows vermin to correctly warn us if we are using the pipe union syntax. Useful to prevent issues like deephaven#5912 in the future. In addition, self-documenting fstrings will be reporteed. Both of these features are labelled as "unstable"; if vermin ever produces a false positive, we can re-consider the inclusion of these features.

For example, it would have produced the following error:

```
Detecting python files..
Analyzing 247 files using 24 processes..
!2, 3.10     /home/devin/dev/deephaven/deephaven-core/py/server/deephaven/_table_reader.py
  union types as `X | Y` require !2, 3.10

Minimum required versions: 3.10
Incompatible versions:     2
Target versions not met:   3.8
```

Here is the documentation for these feature flags:

```
  [--feature <name>] ...
        Some features are disabled by default due to being unstable:
          fstring-self-doc - [Unstable] Detect self-documenting fstrings. Can in
                             some cases wrongly report fstrings as self-documenting.
          union-types      - [Unstable] Detect union types `X | Y`. Can in some cases
                             wrongly report union types due to having to employ heuristics.
```
@devinrsmith devinrsmith merged commit 9bdbac0 into deephaven:main Aug 7, 2024
25 checks passed
@devinrsmith devinrsmith deleted the add-optional-vermin-features branch August 7, 2024 22:17
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants