dart-long-lines
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "dart-long-lines" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9c1b7f3ff3f36ef48cded377953bb128daf597183371b8d84f532aac34a5a0e7. Verify the upstream source and version against https://github.com/kevmoo/dash_skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Guidance for handling long lines in Dart code to comply with an 80-column rule, addressing the lines_longer_than_80_chars rule and describing how to identify and handle overlong lines.
Introduction source: third_party · kevmoo · 0.0.1 Reference
SkillPi interpretation
- Tasks
- |-
- Audience
- Use this skill when: Writing Dart code that might exceed the 80-column limit. Refactoring code to comply with the `lines_longer_than_80_chars` lint. Reference: https://dart.dev/tools/linter-rules/lines_longer_than_80_chars
- Testing
- Not tested
Browse files
Frontmatter
name: dart-long-lines
description: |-
Guidelines for handling long lines in Dart code to adhere to the 80-column
rule. The `lines_longer_than_80_chars` lint.
license: Apache-2.0
key_features:
- 80-column rule compliance
- Line length refactoring
- Linter rule enforcementDart Long Lines
1. When to use this skill
Use this skill when:
- Writing Dart code that might exceed the 80-column limit.
- Refactoring code to comply with the
lines_longer_than_80_charslint. Reference: https://dart.dev/tools/linter-rules/lines_longer_than_80_chars
When NOT to use (Abstention Guardrails)
Do NOT break lines or alter code when:
- Unbreakable URLs & URIs: Lines contain long HTTP/HTTPS URLs, import URIs, or file paths where breaking them across lines would invalidate the link.
- Complex Regular Expression Literals: Long RegExp patterns
(
RegExp(r'...')) where inserting whitespace or line breaks changes the matching semantics. - ASCII Art, Tables, or Preformatted Diagrams: Preformatted text blocks, table rows, or ASCII diagrams inside comments or strings where wrapping lines destroys visual alignment.
- Prior to Automated Formatting: Do NOT manually break code lines before
running
dart format. Letdart formathandle code wrapping automatically; only manually wrap comments, docs, and multi-line strings that the formatter does not re-wrap.
Discovery
To find lines that exceed the limit:
Automated Analysis
The most reliable way to find long lines is to use the Dart analyzer:
- Command:
dart analyze - Lint:
lines_longer_than_80_chars
Manual Search
To search for long lines using regex:
- Regex:
^.{81,}$(Matches any line with 81 or more characters).
2. Guidelines
Format First
Always run dart format before manually breaking long lines. The formatter
often automatically fixes long lines, especially in generated code, and applies
standard Dart styling rules.
Code Comments
Break long code comments (//) cleanly at word boundaries to ensure lines do
not exceed 80 characters. Maintain tight formatting and avoid unnecessary
vertical space.
Documentation Comments (///)
- Apply the same line-breaking rules as for code comments.
- Avoid breaking markdown link blocks like
[name]or[text](http://example.com)across lines. Place them on their own line if they exceed the limit. - Start doc comments with a single summary sentence, followed by a blank line before the rest of the comment. It is okay to break this first sentence across multiple lines to fit the 80-column limit.
- Avoid unresolved references or dangling sentences.
Long Strings
- Use adjacent string literals (e.g.,
'part 1 ' 'part 2') to break long strings. Break at word boundaries. - If a single-line string contains newline characters (
\n) or if there are consecutiveprintstatements, consider migrating to a multi-line string literal (''').
Format and Analyze After Changes
- Run
dart formatanddart analyzeafter making changes. - Be aware that splitting strings may trigger new lints (e.g.,
prefer_single_quotesif a double-quoted string is split into parts that no longer contain single quotes).
3. Examples
Documentation Comment Link
Avoid:
/// This is a long doc comment that contains a link to [a very long
/// URL](http://example.com/very/long/url/that/exceeds/eighty/chars).
Prefer:
/// This is a long doc comment that contains a link to [a very long URL][ref].
///
/// [ref]: http://example.com/very/long/url/that/exceeds/eighty/chars
Adjacent String Literals
Prefer:
final longString = 'This is a very long string that needs to be broken '
'across multiple lines to stay under the limit.';
Multi-line String Migration
Avoid:
print('This is line 1\nThis is line 2 that is also quite long\nThis is line 3 which makes the whole thing exceed eighty characters');
Prefer:
print('''This is line 1
This is line 2 that is also quite long
This is line 3 which makes the whole thing exceed eighty characters''');Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Dart 语言中长行处理的详细指南,涵盖 80 列规则、重构方法、Linter 规则执行等
- 面向 Dart 开发者解决实际编码规范问题,具有明确的技术实用价值
Highlights
- description 清晰描述了 Skill 的用途,触发词具体且边界清晰
Highlights
- 文档结构完整,包含 When to use、Abstention Guardrails、Discovery、Guidelines、Examples 等清晰章节
- 提供了多个端到端示例,frontmatter 完整
Highlights
- 指南中提到的工具(`dart analyze`、`dart format`)来源明确且为标准 Dart 官方工具
- 覆盖了主要异常情况,建议在修改后运行格式化和分析命令,具备确认机制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- dart.dev
- example.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.