Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeps adding and moving blank lines before/after comment inserted by itself #69

Open
badshah400 opened this issue May 6, 2024 · 0 comments

Comments

@badshah400
Copy link

Here is the original spec file (snippet) in a formatting as intended by its author:

...
%if %{with man}
BuildRequires:  doxygen
BuildRequires:  graphviz
%endif
# /SECTION

%description
LAPACK provides routines for solving systems of simultaneous linear
equations,...(snip)

# LAPACK
%package     -n liblapack%{so_ver}
Summary:        Linear Algebra PACKage: Shared Library
Requires(post): update-alternatives
Requires(postun): update-alternatives

%description -n liblapack%{so_ver}
LAPACK provides routines for solving systems of simultaneous linear
equations, ... (snip)

This package provides the shared library for LAPACK.

%package -n %{pname}-devel
Summary:       ...

... (some more package definitions)

# BLAS
%package     -n libblas%{so_ver}
Summary:        Basic Linear Algebra Subprograms: Shared Library
Requires(post): update-alternatives
Requires(postun): update-alternatives

%description -n libblas%{so_ver}
BLAS (Basic Linear Algebra Subprograms) is a standard library for
numerical algebra... (snip)

This package provides the shared library for BLAS.

%package     -n blas-devel
Summary:        Basic Linear Algebra Subprograms: headers and sources for development
Requires:       libblas%{so_ver} = %{version}
...

Here is what happens after format_spec_file has a first go at it:

~> /usr/lib/obs/service/format_spec_file.files/prepare_spec lapack.spec | diff -u lapack.spec -

--- lapack.spec	2024-05-06 20:14:16.230600369 +0530
+++ -	2024-05-06 20:15:58.956174187 +0530
@@ -68,6 +68,7 @@
 both single and double precision.
 
 # LAPACK
+
 %package     -n liblapack%{so_ver}
 Summary:        Linear Algebra PACKage: Shared Library
 Requires(post): update-alternatives
@@ -122,6 +123,7 @@
 This package provides the static library for LAPACK.
 
 # BLAS
+
 %package     -n libblas%{so_ver}
 Summary:        Basic Linear Algebra Subprograms: Shared Library
 Requires(post): update-alternatives
...

OK, fine let us accept it, not too bad. On next commit, format_spec_file has a go at it again:

--- lapack.spec	2024-05-06 20:16:21.448316936 +0530
+++ -	2024-05-06 20:16:51.197976356 +0530
@@ -67,8 +67,8 @@
 similar functionality is provided for real and complex matrices, in
 both single and double precision.
 
-# LAPACK
 
+# LAPACK
 %package     -n liblapack%{so_ver}
 Summary:        Linear Algebra PACKage: Shared Library
 Requires(post): update-alternatives
@@ -122,8 +122,8 @@
 
 This package provides the static library for LAPACK.
 
-# BLAS
 
+# BLAS
 %package     -n libblas%{so_ver}
 Summary:        Basic Linear Algebra Subprograms: Shared Library
 Requires(post): update-alternatives
...

Weird, but let us accept it. Upon next commit it has a go again:

--- lapack.spec	2024-05-06 20:16:55.881938971 +0530
+++ -	2024-05-06 20:16:59.195134832 +0530
@@ -69,6 +69,7 @@
 
 
 # LAPACK
+
 %package     -n liblapack%{so_ver}
 Summary:        Linear Algebra PACKage: Shared Library
 Requires(post): update-alternatives
@@ -124,6 +125,7 @@
 
 
 # BLAS
+
 %package     -n libblas%{so_ver}
 Summary:        Basic Linear Algebra Subprograms: Shared Library
 Requires(post): update-alternatives
...

And so on ad infinitum.

Eventually, after a few osc ci runs which apparently enforces format_spec_file automatically, I have Texas sized blank spaces above all of these comments, which is undesirable and will need manual intervention to fix and commit using --noservice. I don't understand why the formatter keeps "fixing" its own blank lines before/after comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant