From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 009A03C13E2 for ; Thu, 26 Mar 2026 21:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774561340; cv=none; b=VhsrZuigKp9OK3woSOauskhu/vTLj23PYDiDcNFEbtzWFxPMs7A7yld5/j6rQEXq+hltKLaQOEb8yOxOwY1/Q8bC+hPTi6Ev+u/9kMqvFpiQgN2eLIxZIVAOIoPoRqmpknQb4vC25mmXq3g/juc6hcz7z2JdWTXiDEvAdoJW+gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774561340; c=relaxed/simple; bh=ZQN8j2vVjQBiZh6/tfAbQIu9SGxAiQ84Ck8/o0Q3n2U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P9YgRt7uW9ryEeYCt9J7EaQwCvVLBYF+MVNYstZZKchEkmYqvIY7tNZDYhhwEyyxxLrNZbbtz7nheyGluxyMyJzHonaXxczY0bywLbtzHGM8a+k4bXaMeZ/WNUCDtPS3GkiRY0mvWSsIZih0w5N/GsSRm138l3+O2xBLNDE16QE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ITOVA6KY; arc=none smtp.client-ip=74.125.82.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ITOVA6KY" Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-1274204434bso1974737c88.1 for ; Thu, 26 Mar 2026 14:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774561337; x=1775166137; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TsQAC8Meu2U/HZ8TJa0R82yXNZF53pGbPU4ManvaCKY=; b=ITOVA6KYhdwfMYFXtlxqlutZX/Tij0fgmD6KCY6dxojpwQd1FzKnf0LB8Or1vesB2F Ei8qpzw7hZvGc9OYyr/r8JrTI2EC9+es85opsBaPsSHApV4LCm9Sdu2FGfp8WocnTJ2x tSiQ2K3LjYXe3ncs1xUwxq63wwfNfsAAJ/TC6fyKaNaQDBUOYPHv+OMg9KXikVkioEAv m8kL0wURpT5+i/WKCa023hllWqNKDlNU9DwvcsvNzTbyeegw+ONI945eK6xvDq3/kSm1 tymxS39rIQY3xYYLgV1xXN9tIj8r7iqOVS9TY0/+K7yTqEOGH1Y3ZOGl/kybTK9+YYqK Q8MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774561337; x=1775166137; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TsQAC8Meu2U/HZ8TJa0R82yXNZF53pGbPU4ManvaCKY=; b=merTKIvBN5pNLitx3+8OkEDm1jQy2YXaa0MEZvURPK9snvfGVMeOwpd26li7ADHZ7/ e7N9lQe30M9vMbxemHmTin4vhQHDM7zc+1ehlhA6h3cms9twL7wFVYuyS01Zd2qYw5Rv zF35D+SVHeo6Uzb3z840zLYFZ+5mMVo1zklWyLT3SRUSzPP3ADDKWRfi1qO275Qe5eeW Zst9Bi0utXO24iGQEfQfJKDndkKyrzaMs2KkYa0cBo5qi6b8HL3Q6FtJVs6OMgkp+UtQ xmk2lGpXDvpioSBs+WYV/0TSr7Txe09FXoPKwSiTx29bwNDcyLH6nNdbPCdi25kTyxHv S4kA== X-Forwarded-Encrypted: i=1; AJvYcCXwRU6bNEAg6qGW8Xql1xSRGovyhmMcnCdVkFbvFu/8I8KKgWlSDA8WSAqhzkpyG7rGq55qnap1vndiK44=@vger.kernel.org X-Gm-Message-State: AOJu0YwHA149GLN9BN2fGTh/XdjYPZJ0XsGi6cnwoT1ybHmhfhb7BEKN QSHCuHf1NYm5GKpcwAYME5g442cQ7MCND+n3Y9sEtJIOtYc6I5Iits+O X-Gm-Gg: ATEYQzwi43+NCE1qvmIiWzD58ANEi3sEIjwxkDujzrkwEkNakozreuWjXcKy07gq2G1 3CqiOsJFGFTl/UVl4Ax+x5wykk1L7i5a6o+hwX+7bq8TntNyZ7OzvZP9BJXnsOXzRbZLxwj2iki cPnfOCrQUJHNdYuepukwvOC8YhH1/pWp7Sf9cB35KDbcDJxtTTqGe0YkEMUuo4etLoA6iCy/rtZ NKuCdX1w6uMRT5x0gN5bJUp1EohMLSqbP30U2517fYTs6KrQUb/S7DunYpbkWrA5x7pwUNoDb6D YFg/d2ed2Nz6eDAKRJg9mucX3EqP7fJgrX6QP5m3qxZIX1CnbIFY/Si/abprP6fImYvM3lSaxUE JlQnZ00a5bQPmb1PFO03SLpjCD2juD/uS1B734K//M5+DSUr2gn4n/6NnVuBWIUv7GSbiM1jrRB /nXMYJKnYQm78km/NMH8MGcKfrwF5WtVoI7NFud8o8mdoav5zkoZQz5RZ3BhJtDAgL X-Received: by 2002:a05:7022:2209:b0:129:1d25:f1da with SMTP id a92af1059eb24-12aabb0ba74mr1425343c88.3.1774561336810; Thu, 26 Mar 2026 14:42:16 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:c497:6d9d:a11e:c553]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12aa7624247sm5452875c88.11.2026.03.26.14.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 14:42:16 -0700 (PDT) Date: Thu, 26 Mar 2026 14:42:13 -0700 From: Dmitry Torokhov To: Joe Perches Cc: Dwaipayan Ray , Lukas Bulwahn , Andy Whitcroft , Jonathan Corbet , Shuah Khan , workflows@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] checkpatch: allow correctly handle full files on stdin Message-ID: References: <117b6a4c164a9f0ce348044152d00ac22b31b81b.camel@perches.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <117b6a4c164a9f0ce348044152d00ac22b31b81b.camel@perches.com> On Thu, Mar 26, 2026 at 02:36:35PM -0700, Joe Perches wrote: > On Thu, 2026-03-26 at 07:53 -0700, Dmitry Torokhov wrote: > > On Thu, Mar 26, 2026 at 01:46:49AM -0700, Joe Perches wrote: > > On Wed, 2026-03-25 at 23:20 -0700, Dmitry Torokhov wrote: > > checkpatch does not handle full files well when they are passed on > > > > stdin, because it does not know how to treat the text, and whether it is > > > > a C file, or a DTS file, or something else, and so it assumes that when > > > > it works with stdin it should be a unified diff. For full files it > > > > expects to have a file name as an argument and read the contents from > > > > disk. Unfortunately this does not well when trying to use checkpatch as > > > > an online linter and feed it contents of an editor buffer that have not > > > > made it to the disk yet. > > > > > > Why is this useful? > > > Why not save the buffer and then feed the file? > > > > Because when I am editing a file I am not saving it all that often. I > > want to have buffer diagnostic updated when I leave insert mode in vim. > > I believe you are able to keep your own version of checkpatch. As well as my version of the kernel, gcc, clang, editor, git and so on. Do you have any constructive feedback? Right now checkpatch is broken when using "-f" with stdin and I offer a fix. If you have a better way in mind by all means share it. Thanks. -- Dmitry