Skip to content

Commit a91dfb0

Browse files
robelatorclaude
andcommitted
+Update and format
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 64d923b commit a91dfb0

6 files changed

Lines changed: 49 additions & 52 deletions

File tree

README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
<a href="https://www.buymeacoffee.com/dev_cetera" target="_blank"><img align="right" src="https://cdn.buymeacoffee.com/buttons/default-orange.png" height="48"></a>
2-
<a href="https://discord.gg/gEQ8y2nfyX" target="_blank"><img align="right" src="https://raw.githubusercontent.com/dev-cetera/.github/refs/heads/main/assets/icons/discord_icon/discord_icon.svg" height="48"></a>
1+
[![banner](https://github.com/dev-cetera/df_generate_header_comments/blob/v0.6.1/doc/assets/banner.png?raw=true)](https://github.com/dev-cetera)
32

4-
Dart & Flutter Packages by dev-cetera.com & contributors.
5-
6-
[![sponsor](https://img.shields.io/badge/sponsor-grey?logo=github-sponsors)](https://github.com/sponsors/dev-cetera)
7-
[![patreon](https://img.shields.io/badge/patreon-grey?logo=patreon)](https://www.patreon.com/c/RobertMollentze)
83
[![pub](https://img.shields.io/pub/v/df_generate_header_comments.svg)](https://pub.dev/packages/df_generate_header_comments)
9-
[![tag](https://img.shields.io/badge/tag-v0.6.0-purple?logo=github)](https://github.com/dev-cetera/df_generate_header_comments/tree/v0.6.0)
10-
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/dev-cetera/df_generate_header_comments/main/LICENSE)
4+
[![tag](https://img.shields.io/badge/Tag-v0.6.1-purple?logo=github)](https://github.com/dev-cetera/df_generate_header_comments/tree/v0.6.1)
5+
[![buymeacoffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/dev_cetera)
6+
[![sponsor](https://img.shields.io/badge/Sponsor-grey?logo=github-sponsors&logoColor=pink)](https://github.com/sponsors/dev-cetera)
7+
[![patreon](https://img.shields.io/badge/Patreon-grey?logo=patreon)](https://www.patreon.com/robelator)
8+
[![discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/gEQ8y2nfyX)
9+
[![instagram](https://img.shields.io/badge/Instagram-E4405F?logo=instagram&logoColor=white)](https://www.instagram.com/dev_cetera/)
10+
[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://raw.githubusercontent.com/dev-cetera/df_generate_header_comments/main/LICENSE)
1111

1212
---
1313

14-
[![banner](https://github.com/dev-cetera/df_safer_dart/blob/v0.6.0/doc/assets/banner.png?raw=true)](https://github.com/dev-cetera)
15-
1614
<!-- BEGIN _README_CONTENT -->
1715

1816
This tool automatically adds standardized comment headers to your source files, enhancing protection, consistency, and authenticity across your codebase.
@@ -51,12 +49,11 @@ This tool automatically adds standardized comment headers to your source files,
5149

5250
4. Open a terminal at a desired folder then run `--headers -t path/to/header_template.md` in the terminal. This will modify source files in the folder and add the header comments.
5351

54-
5552
<!-- END _README_CONTENT -->
5653

5754
---
5855

59-
☝️ Please refer to the [API reference](https://pub.dev/documentation/df_generate_header_comments/) for more information.
56+
🔍 For more information, refer to the [API reference](https://pub.dev/documentation/df_generate_header_comments/).
6057

6158
---
6259

@@ -66,7 +63,6 @@ This is an open-source project, and we warmly welcome contributions from everyon
6663

6764
### ☝️ Ways you can contribute
6865

69-
- **Buy me a coffee:** If you'd like to support the project financially, consider [buying me a coffee](https://www.buymeacoffee.com/dev_cetera). Your support helps cover the costs of development and keeps the project growing.
7066
- **Find us on Discord:** Feel free to ask questions and engage with the community here: https://discord.gg/gEQ8y2nfyX.
7167
- **Share your ideas:** Every perspective matters, and your ideas can spark innovation.
7268
- **Help others:** Engage with other users by offering advice, solutions, or troubleshooting assistance.
@@ -83,7 +79,6 @@ If you're enjoying this package and find it valuable, consider showing your appr
8379

8480
<a href="https://www.buymeacoffee.com/dev_cetera" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" height="40"></a>
8581

86-
## 🧑‍⚖️ License
82+
## LICENSE
8783

8884
This project is released under the [MIT License](https://raw.githubusercontent.com/dev-cetera/df_generate_header_comments/main/LICENSE). See [LICENSE](https://raw.githubusercontent.com/dev-cetera/df_generate_header_comments/main/LICENSE) for more information.
89-

analysis_options.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
##.title
2-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3-
##
4-
## Copyright © dev-cetera.com & contributors.
5-
##
6-
## The use of this source code is governed by an MIT-style license described in
7-
## the LICENSE file located in this project's root directory.
8-
##
9-
## See: https://opensource.org/license/mit
10-
##
11-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
12-
##.title~
1+
# For dev-cetera.com
2+
# Version: 1
133

144
include: package:lints/recommended.yaml
155

@@ -31,6 +21,7 @@ linter:
3121
prefer_relative_imports: true
3222
prefer_single_quotes: true
3323
require_trailing_commas: true
24+
unawaited_futures: true
3425
unnecessary_this: true
3526

3627
analyzer:
@@ -42,21 +33,26 @@ analyzer:
4233
strict-raw-types: true
4334
exclude:
4435
- build/**
36+
# - '**.g.dart'
4537

4638
errors:
47-
unused_label: ignore
4839
always_declare_return_types: error
4940
avoid_renaming_method_parameters: error
5041
avoid_type_to_string: error
42+
close_sinks: error
43+
collection_methods_unrelated_type: error
5144
depend_on_referenced_packages: error
5245
flutter_style_todos: error
5346
invalid_override_of_non_virtual_member: error
5447
invalid_use_of_protected_member: error
48+
missing_return: error
5549
no_leading_underscores_for_local_identifiers: error
5650
prefer_final_in_for_each: error
5751
prefer_relative_imports: error
52+
record_literal_one_positional_no_trailing_comma: error
5853
unnecessary_new: error
5954
unrelated_type_equality_checks: error
55+
unused_label: ignore
6056
use_key_in_widget_constructors: error
6157

6258
formatter:

bin/analysis_options.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
##.title
2-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3-
##
4-
## Copyright © dev-cetera.com & contributors.
5-
##
6-
## The use of this source code is governed by an MIT-style license described in
7-
## the LICENSE file located in this project's root directory.
8-
##
9-
## See: https://opensource.org/license/mit
10-
##
11-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
12-
##.title~
1+
# For dev-cetera.com
2+
# Version: 1
133

144
include: package:lints/recommended.yaml
155

@@ -31,6 +21,7 @@ linter:
3121
prefer_relative_imports: true
3222
prefer_single_quotes: true
3323
require_trailing_commas: true
24+
unawaited_futures: true
3425
unnecessary_this: true
3526

3627
analyzer:
@@ -42,21 +33,26 @@ analyzer:
4233
strict-raw-types: true
4334
exclude:
4435
- build/**
36+
# - '**.g.dart'
4537

4638
errors:
47-
unused_label: ignore
4839
always_declare_return_types: error
4940
avoid_renaming_method_parameters: error
5041
avoid_type_to_string: error
42+
close_sinks: error
43+
collection_methods_unrelated_type: error
5144
depend_on_referenced_packages: error
5245
flutter_style_todos: error
5346
invalid_override_of_non_virtual_member: error
5447
invalid_use_of_protected_member: error
48+
missing_return: error
5549
no_leading_underscores_for_local_identifiers: error
5650
prefer_final_in_for_each: error
5751
prefer_relative_imports: error
52+
record_literal_one_positional_no_trailing_comma: error
5853
unnecessary_new: error
5954
unrelated_type_equality_checks: error
55+
unused_label: ignore
6056
use_key_in_widget_constructors: error
6157

6258
formatter:

bin/pubspec.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313

1414
name: generate_header_comments
1515
homepage: https://dev-cetera.com/
16-
repository: https://github.com/robmllze/df_generate_comment_headers
1716
funding:
1817
- https://www.buymeacoffee.com/dev_cetera
19-
- https://www.patreon.com/c/RobertMollentze
20-
- https://github.com/sponsors/robmllze
18+
- https://www.patreon.com/c/robelator
19+
- https://github.com/sponsors/robelator
20+
- https://www.patreon.com/c/robelator
21+
- https://github.com/sponsors/robelator
22+
- https://www.buymeacoffee.com/dev_cetera
23+
24+
2125
publish_to: none
2226
## -----------------------------------------------------------------------------
2327

lib/src/generate_header_comments.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ Future<void> generateHeaderComments(
9191
String templateData;
9292
Log.printWhite('Reading template at: $template...');
9393

94-
final result = (await MdTemplateUtility.i.readTemplateFromPathOrUrl(template).value);
94+
final result =
95+
(await MdTemplateUtility.i.readTemplateFromPathOrUrl(template).value);
9596

9697
if (result.isErr()) {
9798
Log.printRed(' Failed to read template!');
@@ -120,9 +121,11 @@ Future<void> generateHeaderComments(
120121
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
121122

122123
Future<void> _generateForFile(String filePath, String template) async {
123-
final commentStarter = langFileCommentStarters[p.extension(filePath).toLowerCase()] ?? '//';
124+
final commentStarter =
125+
langFileCommentStarters[p.extension(filePath).toLowerCase()] ?? '//';
124126
var templateLines = template.split('\n');
125-
final sourceLines = (await FileSystemUtility.i.readLocalFileAsLinesOrNull(filePath)) ?? [];
127+
final sourceLines =
128+
(await FileSystemUtility.i.readLocalFileAsLinesOrNull(filePath)) ?? [];
126129
if (sourceLines.isNotEmpty) {
127130
// Replace leading '//' in all template lines with the comment starter
128131
templateLines = templateLines.map((line) {
@@ -136,7 +139,8 @@ Future<void> _generateForFile(String filePath, String template) async {
136139
final line = sourceLines[n].trim();
137140
if (line.isEmpty || !line.startsWith(commentStarter)) {
138141
final withoutHeader = sourceLines.sublist(n).join('\n');
139-
final withHeader = '${templateLines.join('\n')}\n\n${withoutHeader.trimLeft()}\n';
142+
final withHeader =
143+
'${templateLines.join('\n')}\n\n${withoutHeader.trimLeft()}\n';
140144
await FileSystemUtility.i.writeLocalFile(filePath, withHeader);
141145
break;
142146
}

pubspec.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313

1414
name: df_generate_header_comments
1515
homepage: https://dev-cetera.com/
16-
repository: https://github.com/robmllze/df_generate_comment_headers
1716
funding:
1817
- https://www.buymeacoffee.com/dev_cetera
19-
- https://www.patreon.com/c/RobertMollentze
20-
- https://github.com/sponsors/robmllze
18+
- https://www.patreon.com/c/robelator
19+
- https://github.com/sponsors/robelator
20+
- https://www.patreon.com/c/robelator
21+
- https://github.com/sponsors/robelator
22+
- https://www.buymeacoffee.com/dev_cetera
2123
description: A tool to generate header comments for your source files.
22-
version: 0.6.0
24+
version: 0.6.1
2325
topics:
2426
- source-gen
2527
- build-runner

0 commit comments

Comments
 (0)