Re: [PATCH v3 2/2] maint: prohibit empty first lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 10, 2014 at 01:21:49PM -0600, Eric Blake wrote:
On 06/10/2014 12:18 PM, Roman Bogorodskiy wrote:

+sc_prohibit_empty_first_line:
+	@awk 'BEGIN { fail=0; }						\
+	FNR == 1 { if ($$0 == "") { print FILENAME ":1:"; fail=1; } }	\
+	END { if (fail == 1) {						\
+	  print "$(ME): Prohibited empty first line" > "/dev/stderr";	\
+	} exit fail; }' $$($(VC_LIST_EXCEPT));
+
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null

@@ -1115,3 +1122,6 @@ exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = \

 exclude_file_name_regexp--sc_prohibit_mixed_case_abbreviations = \
   ^src/(vbox/vbox_CAPI.*.h|esx/esx_vi.(c|h)|esx/esx_storage_backend_iscsi.c)$$
+
+exclude_file_name_regexp--sc_prohibit_empty_first_line = \
+  ^(README|daemon/THREADS\.txt|src/esx/README|docs/library.xen|tests/vmwareverdata/fusion-5.0.3.txt)$$

It started to fail for me with this change:

prohibit_empty_first_line
tools/libvirt_win_icon_16x16.ico:1:

Hmm, it might be simpler just to globally exclude all image formats,
rather than repeating lists of image files in affected rules.


Definitely.  It's weird, though, that I'm not seeing this problem.  Is
it because I'm building on Linux?  Why didn't some test box we have
fail as well?

I was able to fix it with:



 exclude_file_name_regexp--sc_prohibit_empty_first_line = \
-  ^(README|daemon/THREADS\.txt|src/esx/README|docs/library.xen|tests/vmwareverdata/fusion-5.0.3.txt)$$
+  ^(README|daemon/THREADS\.txt|src/esx/README|docs/library.xen|tests/vmwareverdata/fusion-5.0.3.txt|tools/.*\.ico)$$

Not quite consistent with other places where we ignore image files; for
example:

exclude_file_name_regexp--sc_trailing_blank = \
 (/qemuhelpdata/|\.(fig|gif|ico|png)$$)

but my thoughts are that we should really ditch those one-off exception
lists for graphic binary files, and instead modify this list:

VC_LIST_ALWAYS_EXCLUDE_REGEX = \
 (^(HACKING|docs/(news\.html\.in|.*\.patch))|\.po)$$


And this looks like the right way to go.  It would deal with possible
future problems as well.  After figuring out the parentheses, I can
ACK this to go in if you want.  I'm hoping to get to cleaning up the
excludes one day.

Martin

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]