diff --git a/.editorconfig b/.editorconfig index 2ccb690..b2b28d5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,7 @@ end_of_line = lf indent_size = 4 indent_style = space insert_final_newline = true -max_line_length = 180 +max_line_length = 120 tab_width = 4 trim_trailing_whitespace = false ij_continuation_indent_size = 8 @@ -39,12 +39,7 @@ ij_css_space_before_opening_brace = true ij_css_use_double_quotes = true ij_css_value_alignment = do_not_align -[*.haml] -indent_size = 2 -ij_haml_keep_indents_on_empty_lines = false - [*.less] -indent_size = 2 ij_less_align_closing_brace_with_properties = false ij_less_blank_lines_around_nested_selector = 1 ij_less_blank_lines_between_blocks = 1 @@ -67,7 +62,6 @@ ij_less_use_double_quotes = true ij_less_value_alignment = 0 [*.sass] -indent_size = 2 ij_sass_align_closing_brace_with_properties = false ij_sass_blank_lines_around_nested_selector = 1 ij_sass_blank_lines_between_blocks = 1 @@ -232,6 +226,7 @@ ij_typescript_method_parameters_new_line_after_left_paren = false ij_typescript_method_parameters_right_paren_on_new_line = false ij_typescript_method_parameters_wrap = off ij_typescript_object_literal_wrap = on_every_item +ij_typescript_object_types_wrap = on_every_item ij_typescript_parentheses_expression_new_line_after_left_paren = false ij_typescript_parentheses_expression_right_paren_on_new_line = false ij_typescript_place_assignment_sign_on_next_line = false @@ -407,6 +402,7 @@ ij_javascript_method_parameters_new_line_after_left_paren = false ij_javascript_method_parameters_right_paren_on_new_line = false ij_javascript_method_parameters_wrap = off ij_javascript_object_literal_wrap = on_every_item +ij_javascript_object_types_wrap = on_every_item ij_javascript_parentheses_expression_new_line_after_left_paren = false ij_javascript_parentheses_expression_right_paren_on_new_line = false ij_javascript_place_assignment_sign_on_next_line = false @@ -501,9 +497,10 @@ ij_javascript_wrap_comments = false [{*.ctp,*.hphp,*.inc,*.module,*.php,*.php4,*.php5,*.phtml}] ij_continuation_indent_size = 4 ij_php_align_assignments = true -ij_php_align_class_constants = false +ij_php_align_class_constants = true +ij_php_align_enum_cases = true ij_php_align_group_field_declarations = false -ij_php_align_inline_comments = true +ij_php_align_inline_comments = false ij_php_align_key_value_pairs = true ij_php_align_match_arm_bodies = true ij_php_align_multiline_array_initializer_expression = true @@ -511,13 +508,13 @@ ij_php_align_multiline_binary_operation = false ij_php_align_multiline_chained_methods = false ij_php_align_multiline_extends_list = true ij_php_align_multiline_for = false -ij_php_align_multiline_parameters = true +ij_php_align_multiline_parameters = false ij_php_align_multiline_parameters_in_calls = false ij_php_align_multiline_ternary_operation = false ij_php_align_named_arguments = true ij_php_align_phpdoc_comments = false ij_php_align_phpdoc_param_names = false -ij_php_anonymous_brace_style = next_line +ij_php_anonymous_brace_style = end_of_line ij_php_api_weight = 28 ij_php_array_initializer_new_line_after_left_brace = true ij_php_array_initializer_right_brace_on_new_line = true @@ -533,7 +530,8 @@ ij_php_blank_lines_after_imports = 1 ij_php_blank_lines_after_opening_tag = 1 ij_php_blank_lines_after_package = 1 ij_php_blank_lines_around_class = 1 -ij_php_blank_lines_around_constants = 1 +ij_php_blank_lines_around_constants = 0 +ij_php_blank_lines_around_enum_cases = 0 ij_php_blank_lines_around_field = 1 ij_php_blank_lines_around_method = 1 ij_php_blank_lines_before_class_end = 0 @@ -543,8 +541,8 @@ ij_php_blank_lines_before_package = 1 ij_php_blank_lines_before_return_statement = 1 ij_php_blank_lines_between_imports = 1 ij_php_block_brace_style = end_of_line -ij_php_call_parameters_new_line_after_left_paren = false -ij_php_call_parameters_right_paren_on_new_line = false +ij_php_call_parameters_new_line_after_left_paren = true +ij_php_call_parameters_right_paren_on_new_line = true ij_php_call_parameters_wrap = on_every_item ij_php_catch_on_new_line = true ij_php_category_weight = 28 @@ -552,6 +550,7 @@ ij_php_class_brace_style = next_line ij_php_comma_after_last_argument = false ij_php_comma_after_last_array_element = true ij_php_comma_after_last_closure_use_var = false +ij_php_comma_after_last_match_arm = true ij_php_comma_after_last_parameter = false ij_php_concat_spaces = true ij_php_copyright_weight = 4 @@ -561,7 +560,7 @@ ij_php_else_if_style = combine ij_php_else_on_new_line = true ij_php_example_weight = 28 ij_php_extends_keyword_wrap = normal -ij_php_extends_list_wrap = off +ij_php_extends_list_wrap = on_every_item ij_php_fields_default_visibility = protected ij_php_filesource_weight = 28 ij_php_finally_on_new_line = true @@ -569,7 +568,7 @@ ij_php_for_brace_force = always ij_php_for_statement_new_line_after_left_paren = false ij_php_for_statement_right_paren_on_new_line = false ij_php_for_statement_wrap = normal -ij_php_force_empty_methods_in_one_line = false +ij_php_force_empty_methods_in_one_line = true ij_php_force_short_declaration_array_style = true ij_php_getters_setters_naming_style = camel_case ij_php_getters_setters_order_style = getters_first @@ -588,13 +587,13 @@ ij_php_keep_blank_lines_after_lbrace = 1 ij_php_keep_blank_lines_before_right_brace = 0 ij_php_keep_blank_lines_in_code = 1 ij_php_keep_blank_lines_in_declarations = 0 -ij_php_keep_control_statement_in_one_line = true +ij_php_keep_control_statement_in_one_line = false ij_php_keep_first_column_comment = false ij_php_keep_indents_on_empty_lines = false ij_php_keep_line_breaks = true ij_php_keep_rparen_and_lbrace_on_one_line = true ij_php_keep_simple_classes_in_one_line = true -ij_php_keep_simple_methods_in_one_line = false +ij_php_keep_simple_methods_in_one_line = true ij_php_lambda_brace_style = end_of_line ij_php_license_weight = 5 ij_php_line_comment_add_space = false @@ -622,13 +621,13 @@ ij_php_parentheses_expression_right_paren_on_new_line = false ij_php_phpdoc_blank_line_before_tags = true ij_php_phpdoc_blank_lines_around_parameters = true ij_php_phpdoc_keep_blank_lines = true -ij_php_phpdoc_param_spaces_between_name_and_description = 1 -ij_php_phpdoc_param_spaces_between_tag_and_type = 1 -ij_php_phpdoc_param_spaces_between_type_and_name = 1 +ij_php_phpdoc_param_spaces_between_name_and_description = 2 +ij_php_phpdoc_param_spaces_between_tag_and_type = 2 +ij_php_phpdoc_param_spaces_between_type_and_name = 2 ij_php_phpdoc_use_fqcn = true ij_php_phpdoc_wrap_long_lines = true ij_php_place_assignment_sign_on_next_line = false -ij_php_place_parens_for_constructor = 0 +ij_php_place_parens_for_constructor = 1 ij_php_property_read_weight = 11 ij_php_property_weight = 10 ij_php_property_write_weight = 12 @@ -705,7 +704,7 @@ ij_php_spaces_within_parentheses = false ij_php_spaces_within_short_echo_tags = true ij_php_spaces_within_switch_parentheses = false ij_php_spaces_within_while_parentheses = false -ij_php_special_else_if_treatment = false +ij_php_special_else_if_treatment = true ij_php_subpackage_weight = 28 ij_php_ternary_operation_signs_on_next_line = true ij_php_ternary_operation_wrap = on_every_item @@ -717,12 +716,12 @@ ij_php_upper_case_boolean_const = false ij_php_upper_case_null_const = false ij_php_uses_weight = 28 ij_php_var_weight = 28 -ij_php_variable_naming_style = snake_case +ij_php_variable_naming_style = camel_case ij_php_version_weight = 8 ij_php_while_brace_force = always ij_php_while_on_new_line = true -[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,composer.lock,jest.config}] +[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,composer.lock,jest.config}] ij_continuation_indent_size = 4 ij_json_array_wrapping = on_every_item ij_json_keep_blank_lines_in_code = 1 @@ -769,11 +768,17 @@ ij_html_space_around_equality_in_attribute = false ij_html_space_inside_empty_tag = true ij_html_text_wrap = off +[{*.http,*.rest}] +indent_size = 0 +ij_continuation_indent_size = 4 +ij_http request_call_parameters_wrap = on_every_item + [{*.markdown,*.md}] ij_markdown_force_one_space_after_blockquote_symbol = true ij_markdown_force_one_space_after_header_symbol = true ij_markdown_force_one_space_after_list_bullet = true ij_markdown_force_one_space_between_words = true +ij_markdown_format_tables = true ij_markdown_insert_quote_arrows_on_wrap = true ij_markdown_keep_indents_on_empty_lines = false ij_markdown_keep_line_breaks_inside_text_blocks = true diff --git a/.env.example b/.env.example deleted file mode 100644 index a98ecdb..0000000 --- a/.env.example +++ /dev/null @@ -1,3 +0,0 @@ -VITE_APP_ALGOLIA_APP_ID= -VITE_APP_ALGOLIA_API_KEY= -VITE_APP_ALGOLIA_INDEX_NAME= diff --git a/.gitattributes b/.gitattributes index b1479fa..da09df5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,17 +1,12 @@ * text=auto .github/ export-ignore -tests/ export-ignore -app/ export-ignore -docs/ export-ignore -excludes/ export-ignore +tests/ export-ignore .editorconfig export-ignore -.env.example export-ignore .gitattributes export-ignore .gitignore export-ignore -package.json export-ignore - +phpunit.php export-ignore phpunit.xml export-ignore diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 4054831..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -open_collective: "laravel-lang" diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 9775782..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Bug -description: Report a bug or other issue - -labels: '👓 needs review' - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - ⚠️Review existing issues to see whether someone else has already reported your issue. - 📖 Please also read [CONTRIBUTING.md](https://laravel-lang.com/contributing.html). - - - type: textarea - id: environment - attributes: - label: Environment - description: | - Tip: Use the `composer info your/namespace` command to get information for Laravel Lang. - Tip: Use the `composer info laravel/framework` command to get information for Laravel Framework. - Tip: Use the `php -v` command to get information for PHP. - value: | - - Extended Lang Translations Template Version: - - Laravel Version: - - PHP Version: - validations: - required: true - - - type: textarea - id: description - attributes: - label: Issue description - description: | - Be as specific and detailed as possible to help us triaging your issue. Screenshots and/or animations can be very useful in helping to understand the issue you're facing. - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - Tip: You can use https://www.screentogif.com to record animations and videos. - validations: - required: true - - - type: textarea - id: steps - attributes: - label: Steps to reproduce - description: Take some time to try and reproduce the issue, then explain how to do so here. - validations: - required: true - - - type: markdown - attributes: - value: | - ❤️ Laravel Lang? Please consider supporting our collective: https://opencollective.com/laravel-lang diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index d351466..0ae3a9b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,14 @@ blank_issues_enabled: false contact_links: + - name: Bug Report + url: https://github.com/Laravel-Lang/common/issues/new?assignees=andrey-helldar&labels=bug%2Cnative-locale-names&template=bug_report.yml&title=%5BBug%5D%3A+&environment-package-name=laravel-lang%2Fnative-locale-names + about: Report a bug or other issue + - name: Feature Request + url: https://github.com/Laravel-Lang/common/issues/new?labels=feature%2Cnative-locale-names&projects=&template=feature_request.yml + about: Propose a new feature - name: Questions & Other - url: https://github.com//discussions + url: https://github.com/Laravel-Lang/common/discussions about: 'If you want to ask about something else, use the discussions.' - - name: Laravel issue + - name: Laravel Issue url: https://github.com/laravel/framework/issues about: 'If you have a question about your Laravel implementation, ask it in your Laravel project.' diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index 1f77142..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Feature Proposal -description: Propose a new feature - -labels: - - '💪 feature request' - -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - ⚠️Review existing issues to see whether someone else has already reported your issue. - 📖 Please also read [CONTRIBUTING.md](https://laravel-lang.com/contributing.html). - - - type: textarea - id: description - attributes: - label: Feature description - description: | - Think through your proposal and describe it clearly. - - Note that features are only added to the most recent version of Laravel Lang. - validations: - required: true - - - type: textarea - id: environment - attributes: - label: Environment - description: | - Tip: Use the `composer info your/namespace` command to get information for Laravel Lang. - Tip: Use the `composer info laravel/framework` command to get information for Laravel Framework. - Tip: Use the `php -v` command to get information for PHP. - value: | - - Extended Lang Translations Template Version: - - Laravel Version: - - PHP Version: - validations: - required: true - - - type: markdown - attributes: - value: | - ❤️ Laravel Lang? Please consider supporting our collective: https://opencollective.com/laravel-lang diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8bd3b8a..f9a6c6b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,6 @@ version: 2 updates: - - - package-ecosystem: github-actions + - package-ecosystem: github-actions directory: / schedule: interval: daily - timezone: UTC - time: '00:00' diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index ec6bbe5..69635d8 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -12,15 +12,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Check the code style - uses: TheDragonCode/codestyler@v3 - if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/main' }} - with: - github_token: ${{ secrets.COMPOSER_TOKEN }} + - name: Detect job name + id: detect + run: | + [[ ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} ]] && NAME="Fix" || NAME="Check" + + echo "name=${NAME}" >> $GITHUB_OUTPUT - - name: Fix the code style + - name: ${{ steps.detect.outputs.name }} the code style uses: TheDragonCode/codestyler@v3 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.COMPOSER_TOKEN }} - fix: true + fix: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + verbose: true diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml deleted file mode 100644 index ab27dd6..0000000 --- a/.github/workflows/phpunit.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: phpunit - -on: [ push ] - -permissions: read-all - -jobs: - laravel: - runs-on: ubuntu-latest - - name: PHP Unit - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - env: - COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }} - - - name: Install dependencies - run: composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: sudo vendor/bin/phpunit --colors=always diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..953a57c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: Tests + +on: [ push, pull_request ] + +permissions: read-all + +jobs: + laravel: + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + php: [ "8.1", "8.2" ] + laravel: [ "10.0" ] + prefer: [ "stable", "lowest" ] + + name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }} ${{ matrix.prefer }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv + coverage: xdebug + + - name: Install dependencies + run: composer require laravel/framework:^${{ matrix.laravel }} --prefer-${{ matrix.prefer }} + + - name: Execute tests + run: vendor/bin/pest diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml deleted file mode 100644 index 031201d..0000000 --- a/.github/workflows/translate.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: translate - -on: - schedule: - - cron: 27 1 * * * - workflow_dispatch: - -permissions: write-all - -jobs: - translate: - uses: Laravel-Lang/.github/.github/workflows/translate.yml@main diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 3430602..ffccc45 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,8 +1,6 @@ name: update on: - schedule: - - cron: 0 0 * * * push: branches: - main @@ -59,7 +57,7 @@ jobs: echo "is_dirty=${IS_DIRTY}" >> "$GITHUB_OUTPUT" - - name: Update status of translations + - name: Update status id: status if: success() run: | @@ -73,6 +71,15 @@ jobs: - name: Push changes uses: ad-m/github-push-action@master + if: success() && + steps.locales.outputs.is_dirty == 1 || + steps.keys.outputs.is_dirty == 1 || + steps.status.outputs.is_dirty == 1 + with: + github_token: ${{ secrets.COMPOSER_TOKEN }} + + - name: Generate docs trigger + uses: myrotvorets/trigger-repository-dispatch-action@v2.0.0 if: | success() && ( steps.locales.outputs.is_dirty == 1 || @@ -80,4 +87,6 @@ jobs: steps.status.outputs.is_dirty == 1 ) with: - github_token: ${{ secrets.COMPOSER_TOKEN }} + token: ${{ secrets.COMPOSER_TOKEN }} + repo: Laravel-Lang/common + type: docs diff --git a/.run/build.run.xml b/.run/build.run.xml deleted file mode 100644 index 2c9d697..0000000 --- a/.run/build.run.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - -