From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aPLyNBOuUWMh0QAAbAwnHQ (envelope-from ) for ; Thu, 20 Oct 2022 22:22:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4FMeNROuUWN+/wAA9RJhRA (envelope-from ) for ; Thu, 20 Oct 2022 22:22:43 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 301818200 for ; Thu, 20 Oct 2022 22:22:43 +0200 (CEST) Received: from localhost ([::1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olc3u-0002bP-9P for larch@yhetil.org; Thu, 20 Oct 2022 16:22:42 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olbx3-0007hL-JC for larch@yhetil.org; Thu, 20 Oct 2022 16:15:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olbww-0007eO-N4 for emacs-orgmode@gnu.org; Thu, 20 Oct 2022 16:15:30 -0400 Received: from mr85p00im-ztdg06011201.me.com ([17.58.23.181]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olbwu-0001Ez-Rq for emacs-orgmode@gnu.org; Thu, 20 Oct 2022 16:15:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1666296925; bh=fDpFsWPdOaDMvKrQo9vqFXCwwlyUHfYbr5bmQ1YKPhk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=QarDtXWgzn7NFNZ90/pIcflTwZ+lzL7plUW/iiGVP0XT2QkoMzitwtM+iUICd0Bnw Dw6bOrG7PyqMsMo1GrQKBvs0XkvJolYHdEBN8c6szOf7orSKZW4gs69mKPQZ3KH1ak f+M3B/X29stAs4slW7ontoFEALgdU1zuzbRj6Oc5lIYFUrzRaB14G5idqAhAN+sxts tHRU0Z3x/N2EHwFge5o1VbJ0Slnz+fRtEDKvfvYIoJYZoMAU+XWM+aQjoHofQDaKH9 tDbc8bg6R+tKsev+x/VumAkSKDgirLK6g+32C2n0i9W5pNzzk1MPbhr8aZea5x5hVH CKhjRTGTy2hyg== Received: from Rudolfs-MacBook-Air.local (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-ztdg06011201.me.com (Postfix) with ESMTPSA id B04C3960AB8 for ; Thu, 20 Oct 2022 20:15:24 +0000 (UTC) From: =?utf-8?Q?Rudolf_Adamkovi=C4=8D?= To: emacs-orgmode@gnu.org Subject: [PATCH] ob-java: Define the list of all supported header arguments Date: Thu, 20 Oct 2022 22:15:21 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Proofpoint-GUID: wS78whll3AQGWS2sChg-bik7WeitRHfk X-Proofpoint-ORIG-GUID: wS78whll3AQGWS2sChg-bik7WeitRHfk X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.572,17.0.605.474.0000000_definitions?= =?UTF-8?Q?=3D2022-01-14=5F01:2022-01-14=5F01,2020-02-14=5F11,2020-01-23?= =?UTF-8?Q?=5F02_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210200124 Received-SPF: pass client-ip=17.58.23.181; envelope-from=salutis@me.com; helo=mr85p00im-ztdg06011201.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666297363; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fDpFsWPdOaDMvKrQo9vqFXCwwlyUHfYbr5bmQ1YKPhk=; b=TReY/e7g6Fjw43OJzzzZjSsRzHk+4ts8cxsXH5Tvy1MpVQzbz33RqUrI54M+DdWFXd2oN6 R9D+9V19yMCbi+tU9+8pwwQ8lOZ2nNON6uA52nx2cZ4zP469xFp1RSeP1kM2HnDjy5hPs+ yRECdVTcpKG2RsmMpXBlkv7exBoJzQh7499MOK3A9NLyDfjJZ6J0rD2HtxcBgmGY7Kta5X ttEqBo5hadXYvMATeLjAUpNfWbIIVfyXkK91qjgqN8btREoMgXoYVVQueNVx5maq+g3wwg CYxSf2qjPfdOOKnlg3GXPxSGJss5G2UVs6sq5HF103ntXtU3Z2OyOIpqHisdlA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666297363; a=rsa-sha256; cv=none; b=aArQrXaMn8RPHHZwi63b5Xv6+iHHpdYQblDEbDGKlh7Umtfijjjd7IDKpHXJYvq0j30wt9 tkrVRtZTrdqW1wPWKqoT/7CaOMLLfMhbroQSSjrIC7V6C972+uxy8gyZ5qZaORd2a8JR0i bpNOPcgJm2IA/t88dfeFYaRaEmmReb0obpASuFWjPHQC+x278G3zk6nPfYbLpegjJpcaE7 pwuRSzb4IgdxZyIfy/52pMZZVNT/XPeLufVtKKPfjwlRyua2OU92tthJ7Dwr6537do5j8Q uH8pPJIMORgL7yrWelTNIP1N0OzJqvbefXgNuRpMuxzYpqKtRF6PtP7RUF2wsA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=QarDtXWg; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.03 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=QarDtXWg; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 301818200 X-Spam-Score: -4.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: 1xPc/qSuTmpD --=-=-= Content-Type: text/plain Hello smart folks! The Org linter warns about *correct* Java source block arguments. The attached patch fixes that. P.S. I originally had two regression tests, not one. The other test checked the '#+property:' version, e.g. #+property: header-args:java+ :dir /tmp #+property: header-args:java+ :classname com.example.Example #+property: header-args:java+ :imports com.example.OtherExample #+property: header-args:java+ :cmpflag -classpath .:/tmp/example/ #+property: header-args:java+ :cmdline -classpath .:/tmp/example/ #+property: header-args:java+ :cmdarg -verbose However, the linter rejects these as unknown header arguments. From what I understand, that look like a separate issue. Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-java-Define-the-list-of-all-supported-header-argu.patch >From 54f008cdfcf4680b3d3bc7107aa640596d5a91bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Thu, 20 Oct 2022 21:31:37 +0200 Subject: [PATCH] ob-java: Define the list of all supported header arguments * lisp/ob-java.el (org-babel-header-args:java): Complete the list of header arguments supported for Java source blocks. * testing/lisp/test-ob-java.el (ob-java/lint-header-arguments): Test that the linter approves of all the supported arguments. --- lisp/ob-java.el | 8 +++++++- testing/lisp/test-ob-java.el | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lisp/ob-java.el b/lisp/ob-java.el index 832214f5c..395dbd20d 100644 --- a/lisp/ob-java.el +++ b/lisp/ob-java.el @@ -53,7 +53,13 @@ directory, so we keep that as the default behavior. [1] https://orgmode.org/manual/Results-of-Evaluation.html") -(defconst org-babel-header-args:java '((imports . :any)) +(defconst org-babel-header-args:java + '((dir . :any) + (classname . :any) + (imports . :any) + (cmpflag . :any) + (cmdline . :any) + (cmdarg . :any)) "Java-specific header arguments.") (defcustom org-babel-java-command "java" diff --git a/testing/lisp/test-ob-java.el b/testing/lisp/test-ob-java.el index 215f1cb51..a62d66557 100644 --- a/testing/lisp/test-ob-java.el +++ b/testing/lisp/test-ob-java.el @@ -21,9 +21,26 @@ ;; along with this program. If not, see . ;;; Code: + (require 'org-test "../testing/org-test") (require 'ob-core) +;;; No Java required + +(ert-deftest ob-java/lint-header-arguments () + (org-test-with-temp-text " +#+header: :dir /tmp +#+header: :classname com.example.Example +#+header: :imports com.example.OtherExample +#+header: :cmpflag -classpath .:/tmp/example/ +#+header: :cmdline -classpath .:/tmp/example/ +#+header: :cmdarg -verbose +#+begin_src java +#+end_src" + (should-not (org-lint '(wrong-header-argument))))) + +;;; Java required + (org-test-for-executable "java") (org-test-for-executable "javac") (unless (featurep 'ob-java) -- 2.38.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "The whole science is nothing more than a refinement of everyday thinking." -- Albert Einstein, 1879-1955 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--