Newline convention inspection
LineSieve helps you work through text-processing code from a Windows project folder. Ask a compatible model to inspect newline handling, then check its suggested changes against mixed-ending fixtures.
def newline_counts(text):
if not isinstance(text, str):
raise ValueError("text.required")
pairs = text.count("\r\n")
remaining = text.replace("\r\n", "")
return {"crlf": pairs, "lf": remaining.count("\n"),
"cr": remaining.count("\r")}| Project | Check mixed endings, an empty buffer and a final line without a terminator, counting each CRLF pair only once. |
|---|---|
| Review before applying | Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes. |
| Connection | Base URL, credentials and a reachable server. |
def newline_counts(text):
if not isinstance(text, str):
raise ValueError("text.required")
pairs = text.count("\r\n")
remaining = text.replace("\r\n", "")
return {"crlf": pairs, "lf": remaining.count("\n"),
"cr": remaining.count("\r")}Change text handling without obscuring the file contract
LineSieve is a Windows coding workspace for working through text-processing changes with a model you connect. Begin with a representative file and explain the difference between the current result and the required one. Keep content rules separate from file-format rules so a request to normalize text does not silently expand into unrelated transformations.
Mixed newline conventions make a useful example. The supplied inspection function distinguishes CRLF pairs from remaining LF and CR characters, giving you a concrete starting point for reviewing your own import or export path. Ask the assistant to inspect that path and identify where detection ends and modification begins before requesting an edit.
Review the proposed code with original and expected fixtures side by side in your own checking process. Include an empty file, mixed endings and a final line without a terminator. Run project tests and inspect the produced file, paying attention to whether the operation changes content that your request intended to preserve.
Unfiltered AI model choice refers to models available through supported OpenAI-compatible or Anthropic connections, subject to their provider's behavior and limits. Supply credentials when needed and verify the server's tools and context capacity. LineSieve gives that model a project conversation; it does not make every connected service or operation local.
Define the text operation before requesting it
How do I distinguish inspection from normalization in my request?
State whether you want a report about existing endings or a modified output file. Name the target convention only for a conversion task. Ask the assistant to explain any writes proposed during an inspection-only request.
Why include a file without a final newline?
It exposes whether the proposed operation also adds or removes a terminator at the end. That may be outside your requirement even if all internal line breaks are converted correctly. Check the exact expected output.
Should sample files contain real customer text?
Use small representative fixtures with the same relevant characters and line endings whenever possible. The model needs the format behavior, not unrelated sensitive content. Confirm where selected context is sent before sharing actual records.
What result should I inspect after running the changed exporter?
Compare the exported bytes and the interpreted text with your expected fixture. Check line endings, final-line behavior and preserved content, then run the surrounding import or export tests to catch changes beyond the helper itself.
LineSieve · Updated 2026-10-25