diff --git a/.clang-format b/.clang-format index f707f03..a0cfb9c 100644 --- a/.clang-format +++ b/.clang-format @@ -2,7 +2,7 @@ Language: Cpp BasedOnStyle: LLVM BreakBeforeBraces: Stroustrup -ColumnLimit: 120 +ColumnLimit: 100 ReflowComments: true IndentWidth: 4 TabWidth: 4 diff --git a/.github/workflows/linux_amd64_clang.yml b/.github/workflows/linux_amd64_clang.yml index 1ace0d3..cf467d9 100644 --- a/.github/workflows/linux_amd64_clang.yml +++ b/.github/workflows/linux_amd64_clang.yml @@ -29,6 +29,7 @@ jobs: cd build cmake --build . - - name: Run test suite + - name: Run the tests run: | ./build/Porytiles-1.x/tests/Porytiles1xTestSuite + ./build/Porytiles-2.x/tests/Porytiles2xUnitTests diff --git a/.github/workflows/linux_amd64_gcc.yml b/.github/workflows/linux_amd64_gcc.yml index f9d5971..e77e2d7 100644 --- a/.github/workflows/linux_amd64_gcc.yml +++ b/.github/workflows/linux_amd64_gcc.yml @@ -27,6 +27,7 @@ jobs: cd build cmake --build . - - name: Run test suite + - name: Run the tests run: | ./build/Porytiles-1.x/tests/Porytiles1xTestSuite + ./build/Porytiles-2.x/tests/Porytiles2xUnitTests diff --git a/.github/workflows/macos_arm64_clang.yml b/.github/workflows/macos_arm64_clang.yml index a568fa9..5804dd3 100644 --- a/.github/workflows/macos_arm64_clang.yml +++ b/.github/workflows/macos_arm64_clang.yml @@ -30,6 +30,7 @@ jobs: cd build cmake --build . - - name: Run test suite + - name: Run the tests run: | ./build/Porytiles-1.x/tests/Porytiles1xTestSuite + ./build/Porytiles-2.x/tests/Porytiles2xUnitTests diff --git a/.github/workflows/macos_arm64_gcc.yml b/.github/workflows/macos_arm64_gcc.yml index 045bd24..2f329f1 100644 --- a/.github/workflows/macos_arm64_gcc.yml +++ b/.github/workflows/macos_arm64_gcc.yml @@ -30,6 +30,7 @@ jobs: cd build cmake --build . - - name: Run test suite + - name: Run the tests run: | ./build/Porytiles-1.x/tests/Porytiles1xTestSuite + ./build/Porytiles-2.x/tests/Porytiles2xUnitTests diff --git a/.github/workflows/pr_dev_build.yml b/.github/workflows/pr_dev_build.yml index 5b0299e..3538568 100644 --- a/.github/workflows/pr_dev_build.yml +++ b/.github/workflows/pr_dev_build.yml @@ -8,3 +8,5 @@ on: jobs: build-linux-amd64-clang: uses: ./.github/workflows/linux_amd64_clang.yml + build-macos-arm64-clang: + uses: ./.github/workflows/macos_arm64_clang.yml diff --git a/.gitignore b/.gitignore index f550d95..22f9351 100644 --- a/.gitignore +++ b/.gitignore @@ -5,11 +5,7 @@ # Build artifacts and executables build/** -cmake-build-debug/** -Porytiles-1.x/build/** -Porytiles-1.x/cmake-build-debug/** -Porytiles-2.x/build/** -Porytiles-2.x/cmake-build-debug/** +cmake-build-*/** # LLVM coverage files default.profraw diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dd8c10..6854cd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.20) project(Porytiles CXX) @@ -8,7 +8,7 @@ enable_testing() set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -# set(CMAKE_VERBOSE_MAKEFILE on) +set(CMAKE_VERBOSE_MAKEFILE OFF) add_subdirectory(Porytiles-1.x) add_subdirectory(Porytiles-2.x) diff --git a/Porytiles-1.x/CMakeLists.txt b/Porytiles-1.x/CMakeLists.txt index 6349807..c03f970 100644 --- a/Porytiles-1.x/CMakeLists.txt +++ b/Porytiles-1.x/CMakeLists.txt @@ -1,5 +1,14 @@ project(Porytiles1x CXX) +# Enable compilation warnings for 1.x +if(MSVC) + add_compile_options(/W4 /WX) +else() + # Cannot enable -Wextra in 1.x since some of our header-only dependencies throw warnings + # that break the build. + add_compile_options(-Wall -Wpedantic -Werror) +endif() + # Enable testing enable_testing() diff --git a/Porytiles-2.x/CMakeLists.txt b/Porytiles-2.x/CMakeLists.txt index 2c16e73..ff39f47 100644 --- a/Porytiles-2.x/CMakeLists.txt +++ b/Porytiles-2.x/CMakeLists.txt @@ -1,13 +1,11 @@ project(Porytiles2x CXX) -# Fetch and build Google Test -include(FetchContent) -FetchContent_Declare( - googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG v1.15.2 -) -FetchContent_MakeAvailable(googletest) +# Enable compilation warnings for 2.x +if(MSVC) + add_compile_options(/W4 /WX) +else() + add_compile_options(-Wall -Wextra -Wpedantic -Werror) +endif() # Set a variable that points to the global include directory for Porytiles-2.x set(PORYTILES_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/Porytiles-2.x/include) @@ -15,6 +13,3 @@ set(PORYTILES_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/Porytiles-2.x/include) add_subdirectory(lib) add_subdirectory(tests) add_subdirectory(tools) - -# Export the library -export(PACKAGE Porytiles2xLib) diff --git a/Porytiles-2.x/include/porytiles/Color/Bgr15.h b/Porytiles-2.x/include/porytiles/Color/Bgr15.h index 1ae6907..33638d0 100644 --- a/Porytiles-2.x/include/porytiles/Color/Bgr15.h +++ b/Porytiles-2.x/include/porytiles/Color/Bgr15.h @@ -1,31 +1,29 @@ #ifndef PORYTILES_COLOR_BGR15_H #define PORYTILES_COLOR_BGR15_H +#include #include namespace porytiles::color { /** * @brief Value object representing a color in 15-bit BGR format. + * + * @details + * TODO 2.x : fill in explanation about BGR format, 5 bits per color, top bit unused, etc. */ class Bgr15 { std::uint16_t bgr; public: /** - * @brief Default constructor for Bgr15. - * - * Initializes a Bgr15 object with default values, equivalent to zero-initialization. - * This constructor is implicitly defined. + * @brief Default constructor for Bgr15. Initializes to 0. */ Bgr15() = default; /** * @brief Construct a Bgr15 object from a 16-bit BGR value. * - * This constructor initializes a Bgr15 object using a 16-bit integer - * that represents a color in 15-bit BGR format. - * * @param bgr The 16-bit BGR value used to initialize the object. */ explicit constexpr Bgr15(const std::uint16_t bgr) : bgr{bgr} {} @@ -33,27 +31,67 @@ class Bgr15 { /** * @brief Constructs a Bgr15 object with the given 8-bit RGB color components. * - * This constructor takes individual red, green, and blue color components, - * scales them down to 5 bits each, and composes them into a 15-bit BGR value. + * @details + * This constructor takes individual red, green, and blue color components, scales them down to + * 5 bits each, and composes them into a 15-bit BGR value. * * @param red The 8-bit red component of the color. * @param green The 8-bit green component of the color. * @param blue The 8-bit blue component of the color. */ - explicit constexpr Bgr15(std::uint8_t red, std::uint8_t green, std::uint8_t blue) + explicit constexpr Bgr15(const std::uint8_t red, const std::uint8_t green, + const std::uint8_t blue) { - bgr = static_cast(((blue / 8) << 10) | ((green / 8) << 5) | (red / 8)); + bgr = static_cast((blue >> 3 << 10) | (green >> 3 << 5) | red >> 3); } /** * @brief Returns the raw 16-bit BGR value. * - * This method provides direct access to the internal 15-bit BGR representation - * of the color. - * * @return The 16-bit BGR value. */ [[nodiscard]] std::uint16_t getRawValue() const; + + /** + * @brief Computes the blue component from the 15-bit BGR color value. + * + * @details + * Extracts the blue color component from the internal 15-bit BGR representation, scales it back + * up to an 8-bit value, and returns it. + * + * @return The 8-bit blue component derived from the 15-bit BGR value. + */ + [[nodiscard]] std::uint8_t computeBlueComponent() const; + + /** + * @brief Computes the green component from the 15-bit BGR color value. + * + * @details + * Extracts the green color component from the internal 15-bit BGR representation, scales it + * back up to an 8-bit value, and returns it. + * + * @return The 8-bit green component derived from the 15-bit BGR value. + */ + [[nodiscard]] std::uint8_t computeGreenComponent() const; + + /** + * @brief Computes the red component from the 15-bit BGR color value. + * + * @details + * Extracts the red color component from the internal 15-bit BGR representation, scales it back + * up to an 8-bit value, and returns it. + * + * @return The 8-bit red component derived from the 15-bit BGR value. + */ + [[nodiscard]] std::uint8_t computeRedComponent() const; + + /** + * @brief Provides a three-way comparison for Bgr15 objects. + * + * @param other The Bgr15 object to compare with. + * @return A std::strong_ordering result indicating the relative order of the objects. + */ + std::strong_ordering operator<=>(const Bgr15 &other) const = default; }; } // end namespace porytiles::color diff --git a/Porytiles-2.x/include/porytiles/Color/ColorConverters.h b/Porytiles-2.x/include/porytiles/Color/ColorConverters.h new file mode 100644 index 0000000..93731a7 --- /dev/null +++ b/Porytiles-2.x/include/porytiles/Color/ColorConverters.h @@ -0,0 +1,15 @@ +#ifndef PORYTILES_COLOR_COLOR_CONVERTERS_H +#define PORYTILES_COLOR_COLOR_CONVERTERS_H + +#include "porytiles/Color/Bgr15.h" +#include "porytiles/Color/Rgba32.h" + +namespace porytiles::color { + +Bgr15 rgbaToBgr(const Rgba32 &rgba); + +Rgba32 bgrToRgba(const Bgr15 &bgr); + +} // namespace porytiles::color + +#endif // PORYTILES_COLOR_COLOR_CONVERTERS_H diff --git a/Porytiles-2.x/include/porytiles/Color/Rgba32.h b/Porytiles-2.x/include/porytiles/Color/Rgba32.h index 72b369b..200c3b9 100644 --- a/Porytiles-2.x/include/porytiles/Color/Rgba32.h +++ b/Porytiles-2.x/include/porytiles/Color/Rgba32.h @@ -1,5 +1,5 @@ -#ifndef PORYTILES_COLOR_RGBA_H -#define PORYTILES_COLOR_RGBA_H +#ifndef PORYTILES_COLOR_RGBA32_H +#define PORYTILES_COLOR_RGBA32_H #include #include @@ -9,6 +9,9 @@ namespace porytiles::color { /** * @brief Value object representing a color in 32-bit RGBA format. + * + * @details + * TODO 2.x : fill in explanation about RGBA format, 8 bits per color, alpha channel, etc */ class Rgba32 { std::uint8_t red; @@ -21,53 +24,73 @@ class Rgba32 { static constexpr std::uint8_t ALPHA_OPAQUE = 0xff; /** - * @brief Default constructor for Rgba32. - * - * Initializes an Rgba32 object with default values. - * The default constructor is implicitly defined and initializes the color components to zero. - * - * @return A default-initialized Rgba32 object. + * @brief Default constructor for Rgba32. Initializes the color and alpha components to zero. */ Rgba32() = default; /** - * @brief Constructs an Rgba32 object with specified red, green, blue, and alpha component values. - * - * This constructor initializes an Rgba32 object with the provided values for each color component. + * @brief Constructs an Rgba32 object with specified red, green, blue, and alpha component + * values. * * @param red The red component value. * @param green The green component value. * @param blue The blue component value. * @param alpha The alpha (transparency) component value. - * @return An Rgba32 object with the specified component values. */ - explicit constexpr Rgba32(const std::uint8_t red, const std::uint8_t green, const std::uint8_t blue, - const std::uint8_t alpha) + explicit constexpr Rgba32(const std::uint8_t red, const std::uint8_t green, + const std::uint8_t blue, const std::uint8_t alpha) : red{red}, green{green}, blue{blue}, alpha{alpha} { } /** - * @brief Constructs an Rgba32 object with specified RGB values and an implicit alpha value of 255. - * - * This constructor initializes an Rgba32 object with the given red, green, and blue component values, - * and automatically sets the alpha component to 255 (fully opaque). + * @brief Constructs an Rgba32 object with specified RGB values and an implicit alpha value of + * 255 (fully opaque). * * @param red The red component of the color. * @param green The green component of the color. * @param blue The blue component of the color. - * @return An Rgba32 object with the specified RGB values and an alpha value of 255. */ - explicit constexpr Rgba32(const std::uint8_t red, const std::uint8_t green, const std::uint8_t blue) + explicit constexpr Rgba32(const std::uint8_t red, const std::uint8_t green, + const std::uint8_t blue) : red{red}, green{green}, blue{blue}, alpha{ALPHA_OPAQUE} { } + /** + * @brief Retrieves the red component of the Rgba32 color. + * + * @return The red component as an 8-bit unsigned integer. + */ + [[nodiscard]] std::uint8_t getRedComponent() const; + + /** + * @brief Retrieves the green component of the Rgba32 color. + * + * @return The green component as an 8-bit unsigned integer. + */ + [[nodiscard]] std::uint8_t getGreenComponent() const; + + /** + * @brief Retrieves the blue component of the Rgba32 color. + * + * @return The blue component as an 8-bit unsigned integer. + */ + [[nodiscard]] std::uint8_t getBlueComponent() const; + + /** + * @brief Retrieves the alpha component of the Rgba32 color. + * + * @return The alpha component as an 8-bit unsigned integer. + */ + [[nodiscard]] std::uint8_t getAlphaComponent() const; + /** * @brief Converts the RGBA color to a JASC-PAL formatted string. * - * This method converts the red, green, and blue components of the Rgba32 object - * into a space-separated string format commonly used in JASC-PAL color palette files. + * @details + * This method converts the red, green, and blue components of the Rgba32 object into a + * space-separated string format commonly used in JASC-PAL color palette files. * * @return A string representation of the color in JASC-PAL format. */ @@ -76,9 +99,6 @@ class Rgba32 { /** * @brief Provides a three-way comparison for Rgba32 objects. * - * The <=> operator allows Rgba32 objects to be compared using the built-in - * strong ordering mechanism, facilitating easy and efficient comparisons. - * * @param other The Rgba32 object to compare with. * @return A std::strong_ordering result indicating the relative order of the objects. */ @@ -87,4 +107,4 @@ class Rgba32 { } // end namespace porytiles::color -#endif // PORYTILES_COLOR_RGBA_H +#endif // PORYTILES_COLOR_RGBA32_H diff --git a/Porytiles-2.x/include/porytiles/Tile/Rgba32Tile.h b/Porytiles-2.x/include/porytiles/Tile/Rgba32Tile.h new file mode 100644 index 0000000..530b3c7 --- /dev/null +++ b/Porytiles-2.x/include/porytiles/Tile/Rgba32Tile.h @@ -0,0 +1,12 @@ +#ifndef PORYTILES_TILE_RGBA32_TILE_H +#define PORYTILES_TILE_RGBA32_TILE_H + +namespace porytiles::color { + +class Rgba32Tile { + +}; + +} // end namespace porytiles::color + +#endif // PORYTILES_TILE_RGBA32_TILE_H diff --git a/Porytiles-2.x/lib/CMakeLists.txt b/Porytiles-2.x/lib/CMakeLists.txt index c3ae238..50a21cb 100644 --- a/Porytiles-2.x/lib/CMakeLists.txt +++ b/Porytiles-2.x/lib/CMakeLists.txt @@ -11,4 +11,6 @@ set_target_properties(Porytiles2xLib PROPERTIES OUTPUT_NAME "${CANONICAL_LIB_NAM target_include_directories(Porytiles2xLib PUBLIC ${PORYTILES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) # Export the library +# TODO 2.x : what's the difference between these two export(TARGETS Porytiles2xLib FILE ${CMAKE_CURRENT_BINARY_DIR}/PorytilesLibraryTargets.cmake) +export(PACKAGE Porytiles2xLib) diff --git a/Porytiles-2.x/lib/Color/ColorConverters.cpp b/Porytiles-2.x/lib/Color/ColorConverters.cpp new file mode 100644 index 0000000..7274bee --- /dev/null +++ b/Porytiles-2.x/lib/Color/ColorConverters.cpp @@ -0,0 +1,27 @@ +#include "porytiles/Color/ColorConverters.h" + +#include "porytiles/Color/Bgr15.h" +#include "porytiles/Color/Rgba32.h" + +namespace porytiles::color { +Bgr15 rgbaToBgr(const Rgba32 &rgba) +{ + /* + * Convert each color channel from 8-bit to 5-bit via a right shift of 3, then shift back into + * the correct position. + */ + return Bgr15{static_cast(rgba.getBlueComponent() >> 3 << 10 | + rgba.getGreenComponent() >> 3 << 5 | + rgba.getRedComponent() >> 3)}; +} + +Rgba32 bgrToRgba(const Bgr15 &bgr) +{ + const auto rawBgr = bgr.getRawValue(); + constexpr auto mask = 0x1f; + const std::uint8_t redComponent = (rawBgr & mask) << 3; + const std::uint8_t greenComponent = (rawBgr >> 5 & mask) << 3; + const std::uint8_t blueComponent = (rawBgr >> 10 & mask) << 3; + return Rgba32{redComponent, greenComponent, blueComponent}; +} +} \ No newline at end of file diff --git a/Porytiles-2.x/lib/Color/Rgba32.cpp b/Porytiles-2.x/lib/Color/Rgba32.cpp index dc3227a..ff1a518 100644 --- a/Porytiles-2.x/lib/Color/Rgba32.cpp +++ b/Porytiles-2.x/lib/Color/Rgba32.cpp @@ -8,3 +8,23 @@ std::string Rgba32::toJascString() const { return std::to_string(red) + " " + std::to_string(green) + " " + std::to_string(blue); } + +std::uint8_t Rgba32::getRedComponent() const +{ + return red; +} + +std::uint8_t Rgba32::getGreenComponent() const +{ + return green; +} + +std::uint8_t Rgba32::getBlueComponent() const +{ + return blue; +} + +std::uint8_t Rgba32::getAlphaComponent() const +{ + return alpha; +} diff --git a/Porytiles-2.x/lib/Tile/Rgba32Tile.cpp b/Porytiles-2.x/lib/Tile/Rgba32Tile.cpp new file mode 100644 index 0000000..2d15e4e --- /dev/null +++ b/Porytiles-2.x/lib/Tile/Rgba32Tile.cpp @@ -0,0 +1,3 @@ +#include "porytiles/Tile/Rgba32Tile.h" + +using namespace porytiles::color; diff --git a/Porytiles-2.x/tests/CMakeLists.txt b/Porytiles-2.x/tests/CMakeLists.txt index c623674..65664cb 100644 --- a/Porytiles-2.x/tests/CMakeLists.txt +++ b/Porytiles-2.x/tests/CMakeLists.txt @@ -1,5 +1,14 @@ project(Porytiles2xUnitTests CXX) +# Fetch and build Google Test +include(FetchContent) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG v1.15.2 +) +FetchContent_MakeAvailable(googletest) + # Get all sources in a list FILE(GLOB TEST_SOURCES */*.cpp) diff --git a/Porytiles-2.x/tests/Color/Bgr15Test.cpp b/Porytiles-2.x/tests/Color/Bgr15Test.cpp index 7c35e80..f0787b6 100644 --- a/Porytiles-2.x/tests/Color/Bgr15Test.cpp +++ b/Porytiles-2.x/tests/Color/Bgr15Test.cpp @@ -1,7 +1,5 @@ #include -#include - #include "porytiles/Color/Bgr15.h" // Just a fun little example of template metaprogramming diff --git a/Porytiles-2.x/tests/Color/ColorConvertersTest.cpp b/Porytiles-2.x/tests/Color/ColorConvertersTest.cpp new file mode 100644 index 0000000..2d4b945 --- /dev/null +++ b/Porytiles-2.x/tests/Color/ColorConvertersTest.cpp @@ -0,0 +1,32 @@ +#include + +#include "porytiles/Color/Bgr15.h" +#include "porytiles/Color/ColorConverters.h" +#include "porytiles/Color/Rgba32.h" + +TEST(ColorConvertersTest, RgbaToBgr) +{ + using namespace porytiles::color; + + constexpr Rgba32 redRgba1{255, 0, 0}; + constexpr Bgr15 redBgr1{31}; + constexpr Bgr15 redBgr2{255, 0, 0}; + EXPECT_EQ(rgbaToBgr(redRgba1), redBgr1); + EXPECT_EQ(rgbaToBgr(redRgba1), redBgr2); + + constexpr Rgba32 yellowRgba1{255, 255, 0}; + constexpr Bgr15 yellowBgr1{1023}; + constexpr Bgr15 yellowBgr2{255, 255, 0}; + EXPECT_EQ(rgbaToBgr(yellowRgba1), yellowBgr1); + EXPECT_EQ(rgbaToBgr(yellowRgba1), yellowBgr2); +} + +TEST(ColorConvertersTest, BgrToRgba) +{ + using namespace porytiles::color; + + constexpr Bgr15 blueBgr1{0, 0, 255}; + constexpr Rgba32 blueRgba1{0, 0, 248}; + + EXPECT_EQ(bgrToRgba(blueBgr1), blueRgba1); +} diff --git a/Porytiles-2.x/tests/Color/Rgba32Test.cpp b/Porytiles-2.x/tests/Color/Rgba32Test.cpp index 6948321..fb1cc12 100644 --- a/Porytiles-2.x/tests/Color/Rgba32Test.cpp +++ b/Porytiles-2.x/tests/Color/Rgba32Test.cpp @@ -5,7 +5,6 @@ TEST(Rgba32Test, TestJascString) { using namespace porytiles::color; - using namespace porytiles::color; constexpr Rgba32 transparentRgba{}; EXPECT_EQ(transparentRgba.toJascString(), "0 0 0"); diff --git a/Porytiles-2.x/tests/Tile/Rgba32TileTest.cpp b/Porytiles-2.x/tests/Tile/Rgba32TileTest.cpp new file mode 100644 index 0000000..1370089 --- /dev/null +++ b/Porytiles-2.x/tests/Tile/Rgba32TileTest.cpp @@ -0,0 +1,11 @@ +#include + +#include "porytiles/Tile/Rgba32Tile.h" + +TEST(Rgba32TileTest, Foo) +{ + using namespace porytiles::color; + + // TODO tests : 2.x implement test Foo + EXPECT_EQ(1, 1); +} diff --git a/Porytiles-2.x/tools/driver/main.cpp b/Porytiles-2.x/tools/driver/main.cpp index 73179ff..10904c6 100644 --- a/Porytiles-2.x/tools/driver/main.cpp +++ b/Porytiles-2.x/tools/driver/main.cpp @@ -3,12 +3,13 @@ #include "porytiles/Color/Bgr15.h" #include "porytiles/Color/Rgba32.h" +#include "porytiles/Color/ColorConverters.h" int main() { using namespace porytiles::color; - const Bgr15 bgr{}; - const Rgba32 rgb{}; + constexpr Bgr15 bgr{}; + constexpr Rgba32 rgb{}; std::cout << "Hello, Porytiles!" << std::endl; std::cout << "My BGR raw value: " << std::to_string(bgr.getRawValue()) << std::endl; std::cout << "My RGB jasc string: " << rgb.toJascString() << std::endl; diff --git a/Scripts/todo.sh b/Scripts/todo.sh index 7d664d2..8e3a0f1 100755 --- a/Scripts/todo.sh +++ b/Scripts/todo.sh @@ -10,6 +10,7 @@ Usage: todo.sh all todo.sh {NOTE,note} todo.sh {FEATURE,feature} todo.sh 1.0.0 + todo.sh 2.x todo.sh tests todo.sh --help @@ -68,6 +69,12 @@ if [[ ${args[0]} == "all" ]]; then rg 'NOTE 1.0.0 :' rg 'FEATURE 1.0.0 :' + # 2.x + rg 'TODO 2.x :' + rg 'FIXME 2.x :' + rg 'NOTE 2.x :' + rg 'FEATURE 2.x :' + # tests rg 'TODO tests :' elif [[ ${args[0]} == "TODO" || ${args[0]} == "todo" ]]; then @@ -83,6 +90,11 @@ elif [[ ${args[0]} == "1.0.0" ]] then rg 'FIXME 1.0.0 :' rg 'NOTE 1.0.0 :' rg 'FEATURE 1.0.0 :' +elif [[ ${args[0]} == "2.x" ]] then + rg 'TODO 2.x :' + rg 'FIXME 2.x :' + rg 'NOTE 2.x :' + rg 'FEATURE 2.x :' elif [[ ${args[0]} == "tests" ]] then rg 'TODO tests :' else