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

clang-tidy: sort includes LLVM style #1320

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions samples/addmoddel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// addmoddel.cpp
// Sample program showing how to add, modify and delete Exif metadata.

#include <cassert>
#include <exiv2/exiv2.hpp>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to keep #include <exiv2/exiv2.hpp> always on top. We would need to add an additional blank line to restrict the sorting


#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

int main(int argc, char* const argv[])
try {
Expand Down
2 changes: 1 addition & 1 deletion samples/conntest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <curl/curl.h>
#endif

#include <iostream>
#include <cstdlib>
#include <iostream>

void httpcon(const std::string& url, bool useHttp1_0 = false) {
Exiv2::Dictionary response;
Expand Down
5 changes: 2 additions & 3 deletions samples/convert-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// convert-test.cpp
// Conversion test driver - make sure you have a copy of the input file around!

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

int main(int argc, char* const argv[])
try {
Expand Down
5 changes: 2 additions & 3 deletions samples/easyaccess-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
// Sample program using high-level metadata access functions

// included header files
#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

using EasyAccessFct = Exiv2::ExifData::const_iterator (*)(const Exiv2::ExifData&);

Expand Down
3 changes: 1 addition & 2 deletions samples/exifcomment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
*/
// *****************************************************************************
// included header files
#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <cassert>

// *****************************************************************************
// Main
Expand Down
5 changes: 2 additions & 3 deletions samples/exifdata-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
*/
// *****************************************************************************
// included header files
#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <iostream>
#include <string>
#include <cassert>

void write(const std::string& file, Exiv2::ExifData& ed);
void print(const std::string& file);
Expand Down
5 changes: 2 additions & 3 deletions samples/exifdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// exifdata.cpp
// Sample program to format exif data in various external formats

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <string>

using format_t = std::map<std::string, int>;
Expand Down
5 changes: 2 additions & 3 deletions samples/exifprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// exifprint.cpp
// Sample program to print the Exif metadata of an image

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

// https://github.com/Exiv2/exiv2/issues/468
#if defined(EXV_UNICODE_PATH) && defined(__MINGW__)
Expand Down
5 changes: 2 additions & 3 deletions samples/exifvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// exifvalue.cpp
// Sample program to print value of an exif key in an image

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <string>

int main(int argc, char* const argv[])
Expand Down
2 changes: 1 addition & 1 deletion samples/geotag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ char* realpath(const char* file,char* path);

#if ! defined(_MSC_VER)
#include <dirent.h>
#include <unistd.h>
#include <sys/param.h>
#include <unistd.h>
#define stricmp strcasecmp
#endif

Expand Down
4 changes: 2 additions & 2 deletions samples/getopt-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#ifdef EXV_HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <iostream>
#include <iomanip>
#include <cassert>
#include <iomanip>
#include <iostream>

#define Safe(x) (x?x:"unknown")
const char* optstring = ":hVvqfbuktTFa:Y:O:D:r:p:P:d:e:i:c:m:M:l:S:g:K:n:Q:";
Expand Down
5 changes: 2 additions & 3 deletions samples/iptceasy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// iptceasy.cpp
// The quickest way to access, set or modify IPTC metadata.

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

int main(int argc, char* const argv[])
try {
Expand Down
5 changes: 2 additions & 3 deletions samples/iptcprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// iptcprint.cpp
// Sample program to print the IPTC metadata of an image

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

int main(int argc, char* const argv[])
try {
Expand Down
5 changes: 2 additions & 3 deletions samples/iptctest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
*/
// *****************************************************************************
// included header files
#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

using namespace Exiv2;

Expand Down
3 changes: 1 addition & 2 deletions samples/key-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
*/
// *****************************************************************************
// included header files
#include <cstring>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <string>
#include <cstring>

using namespace Exiv2;

Expand Down
5 changes: 2 additions & 3 deletions samples/metacopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
*/
// *****************************************************************************
// included header files
#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <fstream>
#include <cassert>
#include <iostream>

// include local header files which are not part of libexiv2
#include "getopt.hpp"
Expand Down
3 changes: 1 addition & 2 deletions samples/mmap-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// mmap-test.cpp
// Simple mmap tests

#include <cstring>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <cstring>

using namespace Exiv2;

Expand Down
3 changes: 1 addition & 2 deletions samples/path-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// path-test.cpp

#include <exiv2/exiv2.hpp>

#include <iostream>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>

Expand Down
5 changes: 2 additions & 3 deletions samples/prevtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// prevtest.cpp
// Test access to preview images

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <string>
#include <iostream>
#include <cassert>
#include <string>

int main(int argc, char* const argv[])
try {
Expand Down
5 changes: 2 additions & 3 deletions samples/remotetest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
// It makes some modifications on the metadata of remote file, reads new metadata from that file
// and reset the metadata back to the original status.

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>

int main(int argc, char* const argv[])
try {
Expand Down
3 changes: 1 addition & 2 deletions samples/stringto-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
// Test conversions from string to long, float and Rational types.

#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <iostream>

const char* testcases[] = {
// bool
Expand Down
3 changes: 1 addition & 2 deletions samples/taglist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
// *****************************************************************************

#include <exiv2/exiv2.hpp>

#include <iostream>
#include <string>
#include <sstream>
#include <string>

using namespace Exiv2;

Expand Down
9 changes: 4 additions & 5 deletions samples/tiff-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
// tiff-test.cpp
// First and very simple TIFF write test.

#include <exiv2/exiv2.hpp>
#include <cassert>
#include <enforce.hpp>

#include <string>
#include <iostream>
#include <exiv2/exiv2.hpp>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <string>

using namespace Exiv2;

Expand Down
5 changes: 2 additions & 3 deletions samples/write-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
*/
// *****************************************************************************
// included header files
#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iomanip>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <utility>
#include <cassert>

// *****************************************************************************
// local declarations
Expand Down
5 changes: 2 additions & 3 deletions samples/write2-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
*/
// *****************************************************************************
// included header files
#include <cassert>
#include <exiv2/exiv2.hpp>

#include <iostream>
#include <iomanip>
#include <iostream>
#include <string>
#include <cassert>

void write(const std::string& file, Exiv2::ExifData& ed);
void print(const std::string& file);
Expand Down
5 changes: 2 additions & 3 deletions samples/xmpparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
// Read an XMP packet from a file, parse it and print all (known) properties.

#include <exiv2/exiv2.hpp>

#include <string>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <string>

int main(int argc, char* const argv[])
try {
Expand Down
5 changes: 2 additions & 3 deletions samples/xmpparser-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
// Read an XMP packet from a file, parse and re-serialize it.

#include <exiv2/exiv2.hpp>

#include <string>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <string>

int main(int argc, char* const argv[])
try {
Expand Down
7 changes: 3 additions & 4 deletions samples/xmpprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
// g++ -o xmprint xmprint.cpp `pkg-config --cflags --libs exiv2`
// ========================================================================

#include <cassert>
#include <exiv2/exiv2.hpp>

#include <string>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <string>

int main(int argc, char** argv)
{
Expand Down
12 changes: 6 additions & 6 deletions samples/xmpsample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// xmpsample.cpp
// Sample/test for high level XMP classes. See also addmoddel.cpp

#include <exiv2/exiv2.hpp>
#include "unused.h"

#include <string>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <exiv2/exiv2.hpp>
#include <iomanip>
#include <iostream>
#include <string>

#include "unused.h"

bool isEqual(float a, float b)
{
Expand Down
Loading