oakmac / oakmac/standard-clojure-style-js

metadata in :require-macros corrupts the requires list

Open
#223 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

namespace v1 blocker
Dominant language
JavaScript
Stars
137
Forks
8
PR merge metrics
No merged PRs in 30d

Description

follow-up to Issue #125

relevant chat

Currently produces a bogus [:no-doc] require-macros entry (confirmed on both your branch and unpatched HEAD — same bug class as #125, different form). Expected mirrors the :require design exactly: metadata array key, metadata line above, travels when sorting.

# metadata on require-macros line

> same as GitHub Issue #125, but for :require-macros
> currently produces a bogus [:no-doc] require

--Input
(ns com.example.my-app
  (:require-macros
   ^:no-doc
   [zzz.macros :as z]
   [aaa.macros]))
--Input

--Expected
(ns com.example.my-app
  (:require-macros
   [aaa.macros]
   ^:no-doc
   [zzz.macros :as z]))
--Expected
# metadata on require-macros line

--Input
(ns com.example.my-app
  (:require-macros
   ^:no-doc
   [zzz.macros :as z]
   [aaa.macros]))
--Input

--Expected
{
  "nsSymbol": "com.example.my-app",
  "requireMacros": [
    {
      "symbol": "aaa.macros"
    },
    {
      "metadata": ["^:no-doc"],
      "symbol": "zzz.macros",
      "as": "z"
    }
  ]
}
--Expected

And for issue 2, I kept metadata as the key name on requireMacros entries rather than inventing a parallel name, since the objects already share symbol/as/commentsAbove conventions with requires.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied :require-macros input and comparing the current parsed and formatted output with the expected examples. Trace the existing handling for :require and the related work from Issue #125, then apply the same metadata behavior to requireMacros; done means the metadata array and ordering match the expected JSON and Clojure output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.