diff --git a/.travis.yml b/.travis.yml index cb1e6078802..f2b08d6bf2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ before_install: script: - export SERENITY_ROOT=$(pwd) - Meta/lint-shell-scripts.sh -- Meta/check-license-headers.sh +- Meta/check-style.sh - cd Toolchain - TRY_USE_LOCAL_TOOLCHAIN=y ./BuildIt.sh - cd "$SERENITY_ROOT" diff --git a/AK/Base64.h b/AK/Base64.h index 0cf8918debe..47266b684da 100644 --- a/AK/Base64.h +++ b/AK/Base64.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include namespace AK { diff --git a/Applications/Browser/BrowserConsoleClient.h b/Applications/Browser/BrowserConsoleClient.h index d8c62d428c1..dd419009fb9 100644 --- a/Applications/Browser/BrowserConsoleClient.h +++ b/Applications/Browser/BrowserConsoleClient.h @@ -23,6 +23,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #pragma once #include diff --git a/Applications/Browser/ConsoleWidget.h b/Applications/Browser/ConsoleWidget.h index a21880136af..9b70deeebd0 100644 --- a/Applications/Browser/ConsoleWidget.h +++ b/Applications/Browser/ConsoleWidget.h @@ -23,6 +23,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #pragma once #include "BrowserConsoleClient.h" diff --git a/Applications/Browser/InspectorWidget.h b/Applications/Browser/InspectorWidget.h index 8c974bc6f62..49e8b30a0f7 100644 --- a/Applications/Browser/InspectorWidget.h +++ b/Applications/Browser/InspectorWidget.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Applications/FileManager/FileUtils.h b/Applications/FileManager/FileUtils.h index a177900ee18..58c3fa054bc 100644 --- a/Applications/FileManager/FileUtils.h +++ b/Applications/FileManager/FileUtils.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include diff --git a/Applications/FontEditor/GlyphEditorWidget.h b/Applications/FontEditor/GlyphEditorWidget.h index ec8080972c8..f53d78d8517 100644 --- a/Applications/FontEditor/GlyphEditorWidget.h +++ b/Applications/FontEditor/GlyphEditorWidget.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Applications/SystemMonitor/GraphWidget.h b/Applications/SystemMonitor/GraphWidget.h index ab98ecf52ee..598e44b2a07 100644 --- a/Applications/SystemMonitor/GraphWidget.h +++ b/Applications/SystemMonitor/GraphWidget.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Demos/Eyes/EyesWidget.h b/Demos/Eyes/EyesWidget.h index bec31cd03fe..365c69b13a1 100644 --- a/Demos/Eyes/EyesWidget.h +++ b/Demos/Eyes/EyesWidget.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/DevTools/HackStudio/Debugger/BacktraceModel.h b/DevTools/HackStudio/Debugger/BacktraceModel.h index e55bfd0bc1f..04a613b77f9 100644 --- a/DevTools/HackStudio/Debugger/BacktraceModel.h +++ b/DevTools/HackStudio/Debugger/BacktraceModel.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include diff --git a/DevTools/HackStudio/Debugger/BreakpointCallback.h b/DevTools/HackStudio/Debugger/BreakpointCallback.h index 80d1f9495db..d6cbce7afdd 100644 --- a/DevTools/HackStudio/Debugger/BreakpointCallback.h +++ b/DevTools/HackStudio/Debugger/BreakpointCallback.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include diff --git a/DevTools/HackStudio/Debugger/VariablesModel.h b/DevTools/HackStudio/Debugger/VariablesModel.h index 85f18c75643..f693b6759df 100644 --- a/DevTools/HackStudio/Debugger/VariablesModel.h +++ b/DevTools/HackStudio/Debugger/VariablesModel.h @@ -25,6 +25,7 @@ */ #pragma once + #include "Debugger.h" #include #include diff --git a/DevTools/ProfileViewer/ProfileTimelineWidget.h b/DevTools/ProfileViewer/ProfileTimelineWidget.h index f1e50c9fb9e..056e07769e5 100644 --- a/DevTools/ProfileViewer/ProfileTimelineWidget.h +++ b/DevTools/ProfileViewer/ProfileTimelineWidget.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include class Profile; diff --git a/Games/Solitaire/SolitaireWidget.h b/Games/Solitaire/SolitaireWidget.h index cd1d8135ca5..4f5207b5ca4 100644 --- a/Games/Solitaire/SolitaireWidget.h +++ b/Games/Solitaire/SolitaireWidget.h @@ -25,6 +25,7 @@ */ #pragma once + #include "CardStack.h" #include #include diff --git a/Kernel/Devices/PATAChannel.h b/Kernel/Devices/PATAChannel.h index c7ac026eddf..09eed4216c6 100644 --- a/Kernel/Devices/PATAChannel.h +++ b/Kernel/Devices/PATAChannel.h @@ -34,17 +34,18 @@ // More information about the ATA spec for PATA can be found here: // ftp://ftp.seagate.com/acrobat/reference/111-1c.pdf // + #pragma once #include #include +#include #include #include #include +#include #include #include -#include -#include namespace Kernel { diff --git a/Kernel/Devices/PATADiskDevice.h b/Kernel/Devices/PATADiskDevice.h index 434aa0dfa1a..9c0f051e26b 100644 --- a/Kernel/Devices/PATADiskDevice.h +++ b/Kernel/Devices/PATADiskDevice.h @@ -27,7 +27,7 @@ // // A Disk Device Connected to a PATA Channel // -// + #pragma once #include diff --git a/Kernel/Devices/SerialDevice.h b/Kernel/Devices/SerialDevice.h index cdfeec109e3..a7f5fd4656c 100644 --- a/Kernel/Devices/SerialDevice.h +++ b/Kernel/Devices/SerialDevice.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include namespace Kernel { diff --git a/Kernel/FileSystem/ext2_types.h b/Kernel/FileSystem/ext2_types.h index 223d8195e50..1f79227daf6 100644 --- a/Kernel/FileSystem/ext2_types.h +++ b/Kernel/FileSystem/ext2_types.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + /* * If linux/types.h is already been included, assume it has defined * everything we need. (cross fingers) Other header files may have diff --git a/Kernel/PCI/IOAccess.h b/Kernel/PCI/IOAccess.h index 57b66da2b64..eb2468c7597 100644 --- a/Kernel/PCI/IOAccess.h +++ b/Kernel/PCI/IOAccess.h @@ -25,6 +25,7 @@ */ #pragma once + #include namespace Kernel { diff --git a/Kernel/PCI/MMIOAccess.h b/Kernel/PCI/MMIOAccess.h index 984dcf31d1d..d763a9bcfb5 100644 --- a/Kernel/PCI/MMIOAccess.h +++ b/Kernel/PCI/MMIOAccess.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include diff --git a/Kernel/Ptrace.h b/Kernel/Ptrace.h index c305cf3f89f..6145ffa6375 100644 --- a/Kernel/Ptrace.h +++ b/Kernel/Ptrace.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include diff --git a/Libraries/LibC/bits/FILE.h b/Libraries/LibC/bits/FILE.h index 6138e577122..94af1c5ed7c 100644 --- a/Libraries/LibC/bits/FILE.h +++ b/Libraries/LibC/bits/FILE.h @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #pragma once #include diff --git a/Libraries/LibC/float.h b/Libraries/LibC/float.h index 94d598cb165..2bf8abd0997 100644 --- a/Libraries/LibC/float.h +++ b/Libraries/LibC/float.h @@ -24,3 +24,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once diff --git a/Libraries/LibC/memory.h b/Libraries/LibC/memory.h index 51ff1457355..506244f4ce1 100644 --- a/Libraries/LibC/memory.h +++ b/Libraries/LibC/memory.h @@ -24,4 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include diff --git a/Libraries/LibC/net/route.h b/Libraries/LibC/net/route.h index 200d97ecb67..a059c287086 100644 --- a/Libraries/LibC/net/route.h +++ b/Libraries/LibC/net/route.h @@ -25,6 +25,7 @@ */ #pragma once + #include struct rtentry { diff --git a/Libraries/LibC/netinet/tcp.h b/Libraries/LibC/netinet/tcp.h index 7a06b15897e..48e7634d645 100644 --- a/Libraries/LibC/netinet/tcp.h +++ b/Libraries/LibC/netinet/tcp.h @@ -23,3 +23,5 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#pragma once diff --git a/Libraries/LibC/sys/arch/i386/regs.h b/Libraries/LibC/sys/arch/i386/regs.h index f367d13f289..f22d0709492 100644 --- a/Libraries/LibC/sys/arch/i386/regs.h +++ b/Libraries/LibC/sys/arch/i386/regs.h @@ -25,6 +25,7 @@ */ #pragma once + #include struct [[gnu::packed]] PtraceRegisters diff --git a/Libraries/LibC/sys/file.h b/Libraries/LibC/sys/file.h index 94d598cb165..2bf8abd0997 100644 --- a/Libraries/LibC/sys/file.h +++ b/Libraries/LibC/sys/file.h @@ -24,3 +24,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once diff --git a/Libraries/LibC/sys/mman.h b/Libraries/LibC/sys/mman.h index 6daca577e3c..4068ce8dd69 100644 --- a/Libraries/LibC/sys/mman.h +++ b/Libraries/LibC/sys/mman.h @@ -24,4 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include diff --git a/Libraries/LibC/sys/sysmacros.h b/Libraries/LibC/sys/sysmacros.h index 94d598cb165..2bf8abd0997 100644 --- a/Libraries/LibC/sys/sysmacros.h +++ b/Libraries/LibC/sys/sysmacros.h @@ -24,3 +24,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once diff --git a/Libraries/LibCore/Forward.h b/Libraries/LibCore/Forward.h index 8725e91d5c8..56b99b8c850 100644 --- a/Libraries/LibCore/Forward.h +++ b/Libraries/LibCore/Forward.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + namespace Core { class ArgsParser; diff --git a/Libraries/LibCore/Gzip.h b/Libraries/LibCore/Gzip.h index 54232ef6b70..a96af59536a 100644 --- a/Libraries/LibCore/Gzip.h +++ b/Libraries/LibCore/Gzip.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include #include diff --git a/Libraries/LibCore/puff.h b/Libraries/LibCore/puff.h index f778ea319a6..5943910403d 100644 --- a/Libraries/LibCore/puff.h +++ b/Libraries/LibCore/puff.h @@ -1,3 +1,5 @@ +#pragma once + /* puff.h Copyright (C) 2002-2013 Mark Adler, all rights reserved version 2.3, 21 Jan 2013 diff --git a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index d28a938bb4f..d19707fbc7d 100644 --- a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include @@ -45,7 +46,7 @@ public: { } - UnsignedBigInteger() {} + UnsignedBigInteger() { } static UnsignedBigInteger create_invalid(); diff --git a/Libraries/LibDebug/Dwarf/AbbreviationsMap.h b/Libraries/LibDebug/Dwarf/AbbreviationsMap.h index 97764741a9f..2067e744950 100644 --- a/Libraries/LibDebug/Dwarf/AbbreviationsMap.h +++ b/Libraries/LibDebug/Dwarf/AbbreviationsMap.h @@ -25,12 +25,14 @@ */ #pragma once + #include "DwarfTypes.h" #include #include #include namespace Dwarf { + class DwarfInfo; class AbbreviationsMap { diff --git a/Libraries/LibDebug/Dwarf/CompilationUnit.h b/Libraries/LibDebug/Dwarf/CompilationUnit.h index 97c4892915c..09f185c2d98 100644 --- a/Libraries/LibDebug/Dwarf/CompilationUnit.h +++ b/Libraries/LibDebug/Dwarf/CompilationUnit.h @@ -25,6 +25,7 @@ */ #pragma once + #include "AbbreviationsMap.h" #include diff --git a/Libraries/LibDebug/Dwarf/DIE.h b/Libraries/LibDebug/Dwarf/DIE.h index 3f405511474..2cb081cb884 100644 --- a/Libraries/LibDebug/Dwarf/DIE.h +++ b/Libraries/LibDebug/Dwarf/DIE.h @@ -25,6 +25,7 @@ */ #pragma once + #include "CompilationUnit.h" #include "DwarfTypes.h" #include diff --git a/Libraries/LibDebug/Dwarf/DwarfInfo.h b/Libraries/LibDebug/Dwarf/DwarfInfo.h index c4c7dbb11c8..f39d168790f 100644 --- a/Libraries/LibDebug/Dwarf/DwarfInfo.h +++ b/Libraries/LibDebug/Dwarf/DwarfInfo.h @@ -25,6 +25,7 @@ */ #pragma once + #include "CompilationUnit.h" #include "DwarfTypes.h" #include diff --git a/Libraries/LibDebug/Dwarf/DwarfTypes.h b/Libraries/LibDebug/Dwarf/DwarfTypes.h index a4f1d271a9f..84f09b6fad2 100644 --- a/Libraries/LibDebug/Dwarf/DwarfTypes.h +++ b/Libraries/LibDebug/Dwarf/DwarfTypes.h @@ -23,7 +23,9 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #pragma once + #include namespace Dwarf { diff --git a/Libraries/LibDebug/Dwarf/Expression.h b/Libraries/LibDebug/Dwarf/Expression.h index 5f71b68b918..235efdea8fd 100644 --- a/Libraries/LibDebug/Dwarf/Expression.h +++ b/Libraries/LibDebug/Dwarf/Expression.h @@ -25,6 +25,7 @@ */ #pragma once + #include "AK/ByteBuffer.h" #include "AK/Types.h" @@ -32,6 +33,7 @@ class PtraceRegisters; namespace Dwarf { namespace Expression { + enum class Type { None, UnsignedIntetger, @@ -52,5 +54,5 @@ enum class Operations : u8 { Value evaluate(const ByteBuffer&, const PtraceRegisters&); -}; -}; +} +} diff --git a/Libraries/LibDebug/Dwarf/LineProgram.h b/Libraries/LibDebug/Dwarf/LineProgram.h index 5abb77b31fb..f49ec173909 100644 --- a/Libraries/LibDebug/Dwarf/LineProgram.h +++ b/Libraries/LibDebug/Dwarf/LineProgram.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include diff --git a/Libraries/LibGUI/FilePicker.h b/Libraries/LibGUI/FilePicker.h index 7831cba0c7a..bdcbfa9aa66 100644 --- a/Libraries/LibGUI/FilePicker.h +++ b/Libraries/LibGUI/FilePicker.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include #include diff --git a/Libraries/LibGUI/Forward.h b/Libraries/LibGUI/Forward.h index 45e14fc3020..33f79815cdf 100644 --- a/Libraries/LibGUI/Forward.h +++ b/Libraries/LibGUI/Forward.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + namespace GUI { class AbstractButton; diff --git a/Libraries/LibGUI/ResizeCorner.h b/Libraries/LibGUI/ResizeCorner.h index c2ebbd9ce3b..842ea2be6e6 100644 --- a/Libraries/LibGUI/ResizeCorner.h +++ b/Libraries/LibGUI/ResizeCorner.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include namespace GUI { diff --git a/Libraries/LibGemini/Forward.h b/Libraries/LibGemini/Forward.h index bf399f10b8f..d0f838bb53d 100644 --- a/Libraries/LibGemini/Forward.h +++ b/Libraries/LibGemini/Forward.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + namespace Gemini { class Document; diff --git a/Libraries/LibGfx/Triangle.h b/Libraries/LibGfx/Triangle.h index 72a566a08fd..8720700cb98 100644 --- a/Libraries/LibGfx/Triangle.h +++ b/Libraries/LibGfx/Triangle.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Libraries/LibHTTP/Forward.h b/Libraries/LibHTTP/Forward.h index 133e077476a..bb64e1d25bf 100644 --- a/Libraries/LibHTTP/Forward.h +++ b/Libraries/LibHTTP/Forward.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + namespace HTTP { class HttpRequest; diff --git a/Libraries/LibJS/MarkupGenerator.h b/Libraries/LibJS/MarkupGenerator.h index 0d1dadead4f..834c094539d 100644 --- a/Libraries/LibJS/MarkupGenerator.h +++ b/Libraries/LibJS/MarkupGenerator.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include #include @@ -61,4 +63,4 @@ private: static String wrap_string_in_style(String source, StyleType type); }; -} \ No newline at end of file +} diff --git a/Libraries/LibJS/Runtime/Date.h b/Libraries/LibJS/Runtime/Date.h index 432ed1b4d23..7770f438f8e 100644 --- a/Libraries/LibJS/Runtime/Date.h +++ b/Libraries/LibJS/Runtime/Date.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Libraries/LibJS/Runtime/Exception.h b/Libraries/LibJS/Runtime/Exception.h index 14082c310fd..00201585bbd 100644 --- a/Libraries/LibJS/Runtime/Exception.h +++ b/Libraries/LibJS/Runtime/Exception.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Libraries/LibLine/Span.h b/Libraries/LibLine/Span.h index 2d12145b1d7..40075c045ba 100644 --- a/Libraries/LibLine/Span.h +++ b/Libraries/LibLine/Span.h @@ -25,6 +25,7 @@ */ #pragma once + #include namespace Line { diff --git a/Libraries/LibLine/Style.h b/Libraries/LibLine/Style.h index 7bf7f46b7c0..00066af1df8 100644 --- a/Libraries/LibLine/Style.h +++ b/Libraries/LibLine/Style.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include diff --git a/Libraries/LibLine/SuggestionDisplay.h b/Libraries/LibLine/SuggestionDisplay.h index a6c56a6a766..6798ada5d80 100644 --- a/Libraries/LibLine/SuggestionDisplay.h +++ b/Libraries/LibLine/SuggestionDisplay.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include diff --git a/Libraries/LibLine/SuggestionManager.h b/Libraries/LibLine/SuggestionManager.h index 913d409b96d..dfe20dd3ef8 100644 --- a/Libraries/LibLine/SuggestionManager.h +++ b/Libraries/LibLine/SuggestionManager.h @@ -25,6 +25,7 @@ */ #pragma once + #include #include #include diff --git a/Libraries/LibWeb/Layout/LayoutReplaced.h b/Libraries/LibWeb/Layout/LayoutReplaced.h index f0446b116cd..2959c3bc369 100644 --- a/Libraries/LibWeb/Layout/LayoutReplaced.h +++ b/Libraries/LibWeb/Layout/LayoutReplaced.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Libraries/LibWeb/PageView.h b/Libraries/LibWeb/PageView.h index 7f53ac3be5d..200e12ea05e 100644 --- a/Libraries/LibWeb/PageView.h +++ b/Libraries/LibWeb/PageView.h @@ -23,6 +23,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #pragma once #include diff --git a/Meta/check-license-headers.sh b/Meta/check-license-headers.sh deleted file mode 100755 index 60cd03151ea..00000000000 --- a/Meta/check-license-headers.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd "$script_path/.." || exit 1 - -# We simply check if the file starts with: -# /* -# * Copyright -PATTERN=$'^/\*\n \* Copyright' -ERRORS=() - -while IFS= read -r f; do - if [[ ! $(cat "$f") =~ $PATTERN ]]; then - ERRORS+=("$f") - fi -done < <(git ls-files -- \ -'*.cpp' \ -'*.h' \ -':!:Tests' \ -':!:Base' \ -':!:Kernel/FileSystem/ext2_fs.h' \ -':!:Libraries/LibC/getopt.cpp' \ -':!:Libraries/LibCore/puff.h' \ -':!:Libraries/LibELF/exec_elf.h' \ -) - -if (( ${#ERRORS[@]} )); then - echo "Files missing license headers: ${ERRORS[*]}" - exit 1 -fi diff --git a/Meta/check-style.sh b/Meta/check-style.sh new file mode 100755 index 00000000000..810b335e30b --- /dev/null +++ b/Meta/check-style.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) +cd "$script_path/.." || exit 1 + +# We simply check if the file starts with: +# /* +# * Copyright +LICENSE_HEADER_PATTERN=$'^/\*\n \* Copyright' +MISSING_LICENSE_HEADER_ERRORS=() + +# We check that "#pragma once" is present +PRAGMA_ONCE_PATTERN='#pragma once' +MISSING_PRAGMA_ONCE_ERRORS=() + +# We make sure that there's a blank line before and after pragma once +GOOD_PRAGMA_ONCE_PATTERN=$'(^|\\S\n\n)#pragma once(\n\n\\S.|$)' +BAD_PRAGMA_ONCE_ERRORS=() + +while IFS= read -r f; do + file_content="$(< "$f")" + if [[ ! "$file_content" =~ $LICENSE_HEADER_PATTERN ]]; then + MISSING_LICENSE_HEADER_ERRORS+=("$f") + fi + if [[ "$f" =~ \.h$ ]]; then + if [[ ! "$file_content" =~ $PRAGMA_ONCE_PATTERN ]]; then + MISSING_PRAGMA_ONCE_ERRORS+=("$f") + elif [[ ! "$file_content" =~ $GOOD_PRAGMA_ONCE_PATTERN ]]; then + BAD_PRAGMA_ONCE_ERRORS+=("$f") + fi + fi +done < <(git ls-files -- \ + '*.cpp' \ + '*.h' \ + ':!:Tests' \ + ':!:Base' \ + ':!:Kernel/FileSystem/ext2_fs.h' \ + ':!:Libraries/LibC/getopt.cpp' \ + ':!:Libraries/LibCore/puff.h' \ + ':!:Libraries/LibELF/exec_elf.h' \ +) + +exit_status=0 +if (( ${#MISSING_LICENSE_HEADER_ERRORS[@]} )); then + echo "Files missing license headers: ${MISSING_LICENSE_HEADER_ERRORS[*]}" + exit_status=1 +fi +if (( ${#MISSING_PRAGMA_ONCE_ERRORS[@]} )); then + echo "Header files missing \"#pragma once\": ${MISSING_PRAGMA_ONCE_ERRORS[*]}" + exit_status=1 +fi +if (( ${#BAD_PRAGMA_ONCE_ERRORS[@]} )); then + echo "\"#pragma once\" should have a blank line before and after in these files: ${BAD_PRAGMA_ONCE_ERRORS[*]}" + exit_status=1 +fi +exit "$exit_status" diff --git a/Services/LookupServer/DNSResponse.h b/Services/LookupServer/DNSResponse.h index 0301c120758..2bfe17fecdf 100644 --- a/Services/LookupServer/DNSResponse.h +++ b/Services/LookupServer/DNSResponse.h @@ -24,14 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #pragma once #include "DNSAnswer.h" #include "DNSQuestion.h" +#include #include #include -#include class DNSResponse { public: @@ -69,7 +68,7 @@ public: Code code() const { return (Code)m_code; } private: - DNSResponse() {} + DNSResponse() { } u16 m_id { 0 }; u8 m_code { 0 }; diff --git a/Services/SystemMenu/ShutdownDialog.h b/Services/SystemMenu/ShutdownDialog.h index 852e6b46b96..73f581916cf 100644 --- a/Services/SystemMenu/ShutdownDialog.h +++ b/Services/SystemMenu/ShutdownDialog.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include #include diff --git a/Services/Taskbar/TaskbarWindow.h b/Services/Taskbar/TaskbarWindow.h index 5825012439a..4173ac76261 100644 --- a/Services/Taskbar/TaskbarWindow.h +++ b/Services/Taskbar/TaskbarWindow.h @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #include "WindowList.h" #include #include