google / google/addlicense

Introduce a flag to prefer `//` over `/*...*/`

Open
#130 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
886
Forks
194
PR merge metrics
No merged PRs in 30d

Description

It would be great to have a non-multiline comment support enabled with a new flag. Multiline comments `/*\n*\n*\n*/` takes more lines and makes it harder to read for me. Here is a simple proposal:

```
$ touch foo.c
$ addlicense -s=only -c Furkan .
```

Actual: (Multiline comment)
```
/*
* Copyright 2022 Furkan
* SPDX-License-Identifier: Apache-2.0
*/
```

New flag way: (comment)
```
// Copyright 2022 Furkan
// SPDX-License-Identifier: Apache-2.0
```

Contributor guide

Open the contributing guide

Research direction

Start at the addlicense CLI and trace flag parsing to the code that renders license headers. Compare the existing multiline output with the requested // form and determine how the new flag should select it. Done means the flag produces the shown single-line comment format for foo.c while the current default remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.