Skip to content

Commit

Permalink
replace unremovable devlogs with LL temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
familyfriendlymikey committed Jan 23, 2024
1 parent 55d9bfe commit aa02c6e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/imba/src/utils/fmt.imba
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const E = do
console.error String($1).red
process.exit!

const devlog = /^\s*\bL\b.*$/
const devlog = /^(\s*)\b(L)\b(.*)$/
const extra-lines = /\n\n\n+/gm
const commented-log = /^\s*#\s+(console\.|L)\b.*\n/gm
const comment = /^\s*#/
Expand Down Expand Up @@ -45,7 +45,7 @@ def remove-devlogs contents, filename

continue if pt is ct or ct is nt

result.push line
result.push line.replace(devlog,'$1LL$3')

result.join("\n")

Expand Down Expand Up @@ -117,10 +117,5 @@ export default def fmt args, opts
contents = contents.replaceAll trailing-whitespace, ''
contents = contents.replaceAll extra-lines, '\n\n'

if args.includes('devlogs') or !args.length
for line,i in contents.split('\n')
if devlog.test line
console.warn "Unable to remove devlog in {filename}:{i+1}:{line.indexOf('L')+1} due to indent".yellow

continue if prev is contents
fs.writeFileSync filename, contents

0 comments on commit aa02c6e

Please sign in to comment.