Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

wemake-python-styleguide

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wemake-python-styleguide - npm Package Compare versions

Comparing version
0.19.0
to
0.19.1
+1
-1
PKG-INFO
Metadata-Version: 2.1
Name: wemake-python-styleguide
Version: 0.19.0
Version: 0.19.1
Summary: The strictest and most opinionated python linter ever

@@ -5,0 +5,0 @@ Home-page: https://wemake-python-styleguide.rtfd.io

[tool.poetry]
name = "wemake-python-styleguide"
version = "0.19.0"
version = "0.19.1"
description = "The strictest and most opinionated python linter ever"

@@ -5,0 +5,0 @@

@@ -684,2 +684,4 @@ """

.. versionchanged:: 0.5.0
.. versionchanged:: 0.19.1
Do not report ``...`` when used in a function or class body.

@@ -686,0 +688,0 @@ """

@@ -6,2 +6,4 @@ import ast

from wemake_python_styleguide.compat.aliases import FunctionNodes
from wemake_python_styleguide.logic.nodes import get_parent
from wemake_python_styleguide.violations.complexity import (

@@ -59,2 +61,11 @@ TooDeepNestingViolation,

def _check_offset(self, node: ast.AST) -> None:
is_function_ellipsis = (
isinstance(get_parent(node), (*FunctionNodes, ast.ClassDef)) and
isinstance(node, ast.Expr) and
isinstance(node.value, ast.Constant) and
node.value.value is Ellipsis
)
if is_function_ellipsis:
return
offset = getattr(node, 'col_offset', 0)

@@ -61,0 +72,0 @@ baseline = self._max_offset_blocks * 4

@@ -223,2 +223,3 @@ import ast

node: ast.Expr,
*,
is_first: bool = False,

@@ -233,2 +234,12 @@ ) -> None:

parent = nodes.get_parent(node)
is_only_ellipsis_node = (
isinstance(node.value, ast.Constant) and
node.value.value is Ellipsis and
isinstance(parent, (*FunctionNodes, ast.ClassDef)) and
len(parent.body) == 1
)
if is_only_ellipsis_node:
return
self.add_violation(StatementHasNoEffectViolation(node))

@@ -235,0 +246,0 @@

Sorry, the diff of this file is too big to display