oakmac / oakmac/standard-clojure-style-js
bug: formatter deletes file contents if `ns` form is unclosed
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 137
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
This came up when I was editing imports in a namespace and deleted the closing paren by mistake.
Example input:
(ns example
(:require
[clojure.math :as math])
(doseq [i (range 100)]
(println {:a i}))
Formatter output:
(ns example
(:require
[clojure.math :as math]))
From what I can tell, this bug will happily delete thousands of lines of source code.
This occurred on version v0.12.0 of the formatter.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the formatter output from the unclosed ns example on version v0.12.0, then trace the formatter's handling of an unclosed namespace form. Done means formatting preserves the following doseq and other source contents instead of deleting them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100