openrewrite / rewrite

Automated mass refactoring of source code.
https://docs.openrewrite.org
Apache License 2.0
2.09k stars 312 forks source link

Issue discovered on `django/core/handlers/asgi.py` with `End files with a single newline` #3237

Open moderne-meeseeks[bot] opened 1 year ago

moderne-meeseeks[bot] commented 1 year ago

Problem

This changes the behaviour of the codebase by removing the self reference.

Expected behavior

self should not be removed

Example diff

From: django/core/handlers/asgi.py

      query_string = self.scope.get("query_string", "")
if isinstance(query_string, bytes):
    query_string = query_string.decode()
-        self.META = {
+        META = {
    "REQUEST_METHOD": self.method,
    "QUERY_STRING": query_string,
    "SCRIPT_NAME": self.script_name,
          yield (data[position : position + cls.chunk_size],
        (position + cls.chunk_size) >= len(data))
    position += cls.chunk_size
+

Recipes in example diff:

References:


This issue originally created by @JLLeitschuh on: https://github.com/moderneinc/support-public/issues/45

moderne-meeseeks[bot] commented 1 year ago

This comment originially written by @ on: