-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve codecov & reformat code (#849)
* chore: refactor code * feat: add codecov for formatter * feat: improve codecov for date module * refactor: move locale to seperate file
- Loading branch information
1 parent
222c890
commit 6daddc1
Showing
106 changed files
with
5,116 additions
and
7,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,142 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
#include "faker-cxx/export.h" | ||
|
||
namespace faker::airline | ||
{ | ||
/** | ||
* @brief Get a random aircraft type | ||
* | ||
* @return a random aircraft type | ||
* | ||
* @code | ||
* faker::airline::aircraftType // "narrowbody" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string_view aircraftType(); | ||
/** | ||
* @brief Get a random aircraft type | ||
* | ||
* @return a random aircraft type | ||
* | ||
* @code | ||
* faker::airline::aircraftType // "narrowbody" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string_view aircraftType(); | ||
|
||
struct FAKER_CXX_EXPORT Airplane | ||
{ | ||
std::string_view name; | ||
std::string_view iataTypeCode; | ||
}; | ||
struct FAKER_CXX_EXPORT Airplane | ||
{ | ||
std::string_view name; | ||
std::string_view iataTypeCode; | ||
}; | ||
|
||
/** | ||
* @brief Get a random airplane | ||
* | ||
* @return a random airplane and its iataTypeCode | ||
* | ||
* @code | ||
* faker::airline::airplane() // {"Boeing 737-800", "738"} | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT Airplane airplane(); | ||
/** | ||
* @brief Get a random airplane | ||
* | ||
* @return a random airplane and its iataTypeCode | ||
* | ||
* @code | ||
* faker::airline::airplane() // {"Boeing 737-800", "738"} | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT Airplane airplane(); | ||
|
||
struct FAKER_CXX_EXPORT AirlineInfo | ||
{ | ||
std::string_view name; | ||
std::string_view iataCode; | ||
}; | ||
struct FAKER_CXX_EXPORT AirlineInfo | ||
{ | ||
std::string_view name; | ||
std::string_view iataCode; | ||
}; | ||
|
||
/** | ||
* @brief Get a random airline | ||
* | ||
* @return a random airline and its iataCode | ||
* | ||
* @code | ||
* faker::airline::airline() // {"Air Canada", "AC"} | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT AirlineInfo airline(); | ||
/** | ||
* @brief Get a random airline | ||
* | ||
* @return a random airline and its iataCode | ||
* | ||
* @code | ||
* faker::airline::airline() // {"Air Canada", "AC"} | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT AirlineInfo airline(); | ||
|
||
struct FAKER_CXX_EXPORT Airport | ||
{ | ||
std::string_view name; | ||
std::string_view iataCode; | ||
}; | ||
struct FAKER_CXX_EXPORT Airport | ||
{ | ||
std::string_view name; | ||
std::string_view iataCode; | ||
}; | ||
|
||
/** | ||
* @brief Get a random airport | ||
* | ||
* @return a random airport and its iataCode | ||
* | ||
* @code | ||
* faker::airline::airport() // {"Toronto Pearson International Airport", "YYZ"} | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT Airport airport(); | ||
/** | ||
* @brief Get a random airport | ||
* | ||
* @return a random airport and its iataCode | ||
* | ||
* @code | ||
* faker::airline::airport() // {"Toronto Pearson International Airport", "YYZ"} | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT Airport airport(); | ||
|
||
enum class AircraftType | ||
{ | ||
Regional, | ||
Narrowbody, | ||
Widebody, | ||
}; | ||
enum class AircraftType | ||
{ | ||
Regional, | ||
Narrowbody, | ||
Widebody, | ||
}; | ||
|
||
/** | ||
* @brief Get a random seat by aircraft type | ||
* | ||
* @param aircraftType the aircraft type | ||
* | ||
* @return a random seat | ||
* | ||
* @code | ||
* faker::airline::seat(AircraftType::Narrowbody) // "1A" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string seat(AircraftType aircraftType); | ||
/** | ||
* @brief Get a random seat by aircraft type | ||
* | ||
* @param aircraftType the aircraft type | ||
* | ||
* @return a random seat | ||
* | ||
* @code | ||
* faker::airline::seat(AircraftType::Narrowbody) // "1A" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string seat(AircraftType aircraftType); | ||
|
||
/** | ||
* @brief Get a random record location | ||
* | ||
* @return a random record location | ||
* | ||
* @code | ||
* faker::airline::recordLocator() // "ABCDEF" | ||
* faker::airline::recordLocator(true) // "ABC123" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string recordLocator(bool allowNumerics = false); | ||
/** | ||
* @brief Get a random record location | ||
* | ||
* @return a random record location | ||
* | ||
* @code | ||
* faker::airline::recordLocator() // "ABCDEF" | ||
* faker::airline::recordLocator(true) // "ABC123" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string recordLocator(bool allowNumerics = false); | ||
|
||
/** | ||
* @brief Get a random flight number from given length | ||
* | ||
* @param addLeadingZeros whether to add leading zeros | ||
* | ||
* @param length the length of the flight number | ||
* | ||
* @return a random flight number | ||
* | ||
* @code | ||
* faker::airline::flightNumber() // "1234" | ||
* faker::airline::flightNumber(true) // "0123" | ||
* faker::airline::flightNumber(false, 3) // "234" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string flightNumber(bool addLeadingZeros = false, unsigned int length = 4); | ||
/** | ||
* @brief Get a random flight number from given length | ||
* | ||
* @param addLeadingZeros whether to add leading zeros | ||
* | ||
* @param length the length of the flight number | ||
* | ||
* @return a random flight number | ||
* | ||
* @code | ||
* faker::airline::flightNumber() // "1234" | ||
* faker::airline::flightNumber(true) // "0123" | ||
* faker::airline::flightNumber(false, 3) // "234" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string flightNumber(bool addLeadingZeros = false, unsigned int length = 4); | ||
|
||
struct FAKER_CXX_EXPORT Range | ||
{ | ||
unsigned int min; | ||
unsigned int max; | ||
}; | ||
struct FAKER_CXX_EXPORT Range | ||
{ | ||
unsigned int min; | ||
unsigned int max; | ||
}; | ||
|
||
/** | ||
* @brief Get a random flight number from given length | ||
* | ||
* @param addLeadingZeros whether to add leading zeros | ||
* | ||
* @param length the length of the flight number | ||
* | ||
* @return a random flight number | ||
* | ||
* @code | ||
* faker::airline::flightNumber() // "1234" | ||
* faker::airline::flightNumber(true) // "0123" | ||
* faker::airline::flightNumber(false, {1, 4}) // "234" // "12" // "1234" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string flightNumberByRange(bool addLeadingZeros = false, Range length = {1, 4}); | ||
/** | ||
* @brief Get a random flight number from given length | ||
* | ||
* @param addLeadingZeros whether to add leading zeros | ||
* | ||
* @param length the length of the flight number | ||
* | ||
* @return a random flight number | ||
* | ||
* @code | ||
* faker::airline::flightNumber() // "1234" | ||
* faker::airline::flightNumber(true) // "0123" | ||
* faker::airline::flightNumber(false, {1, 4}) // "234" // "12" // "1234" | ||
* @endcode | ||
*/ | ||
FAKER_CXX_EXPORT std::string flightNumberByRange(bool addLeadingZeros = false, Range length = {1, 4}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
#include "faker-cxx/export.h" | ||
|
||
namespace faker::animal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
#include "faker-cxx/export.h" | ||
|
||
namespace faker::book | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
#include "faker-cxx/export.h" | ||
|
||
namespace faker::commerce | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
#include <optional> | ||
#include <string_view> | ||
|
||
#include "faker-cxx/export.h" | ||
|
||
namespace faker::company | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
|
||
#include <string_view> | ||
|
||
#include "faker-cxx/export.h" | ||
|
||
namespace faker::computer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.