AdaCore / AdaCore/gnatstudio

Auto-fix adds space at the wrong place for style check

Open
#145 1 comment 0 reactions 1 assignee View on GitHub

@AnthonyLeonardoGracio is already working on this.

Since May 19, 2023.

bug
Dominant language
Ada
Stars
531
Forks
65
PR merge metrics
No merged PRs in 30d

Description

Hereafter is a reproducer for the issue in title. A consequence is that it ruins the indentation, which can be annoying if auto-fix is applied on many cases at a time (via "Fix all simple style errors").

wrenched.adb:

with Ada.Text_IO;

procedure Wrenched is
   use Ada.Text_IO;
begin
   put_line("oh");
   --
   --  Apply the style fix to the following style errors:
   --
   --  main.adb:6:3: (style) bad casing of "Put_Line" declared at a-textio.ads:509
   --  main.adb:6:11: (style) space required
   --
   --  Result is ` Put_Line("oh");` instead of `Put_Line ("oh");`
   --
end Wrenched;

wrenched.gpr:

project Wrenched is

   for Object_Dir use "obj";
   for Main use ("wrenched.adb");
   for Create_Missing_Dirs use "True";

   package Compiler is
      for Switches ("ada") use ("-gnatytr");
   end Compiler;

end Wrenched;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.