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

pint.md / upgrade.md 번역 완료 #493

Open
wants to merge 2 commits into
base: pre-kr-10.x
Choose a base branch
from
Open
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
144 changes: 46 additions & 98 deletions kr/pint.md
Original file line number Diff line number Diff line change
@@ -1,205 +1,153 @@
# Laravel Pint
# 라라벨 Pint

- [Introduction](#introduction)
- [시작하기](#introduction)
- [Installation](#installation)
- [소개](#introduction)
- [설치](#installation)
- [Running Pint](#running-pint)
- [Pint 실행하기](#running-pint)
- [Configuring Pint](#configuring-pint)
- [Pint 설정하기](#configuring-pint)
- [Presets](#presets)
- [프리셋](#presets)
- [Rules](#rules)
- [규칙](#rules)
- [Excluding Files / Folders](#excluding-files-or-folders)
- [파일 / 폴더 제외하기](#excluding-files-or-folders)
- [실행](#running-pint)
- [설정](#configuring-pint)
- [프리셋](#presets)
- [규칙](#rules)
- [파일/폴더 제외](#excluding-files-or-folders)

<a name="introduction"></a>
## Introduction
## 시작하기

[Laravel Pint](https://github.com/laravel/pint) is an opinionated PHP code style fixer for minimalists. Pint is built on top of PHP-CS-Fixer and makes it simple to ensure that your code style stays clean and consistent.
## 소개

[라라벨 Pint](https://github.com/laravel/pint)는 미니멀리스트를 위한 독창적인 PHP 코드 스타일 해결사입니다. Pint는 PHP-CS-Fixer를 기반으로 구축되었으며 코드 스타일이 깨끗하고 일관성을 유지하도록 간단하게 해줍니다.
[라라벨 파인트](https://github.com/laravel/pint) 는 미니멀리스트를 위한 PHP만의 고유한 코드 수정 도구입니다. 파인트는 PHP-CS-FIXER 기반으로 구축되었으며 코드 스타일을 간결하고 일관되게 유지하는 것을 더욱 간편하게 해줍니다.

Pint is automatically installed with all new Laravel applications so you may start using it immediately. By default, Pint does not require any configuration and will fix code style issues in your code by following the opinionated coding style of Laravel.

Pint는 모든 새로운 라라벨 애플리케이션과 함께 자동으로 설치되므로 즉시 사용할 수 있습니다. 기본적으로 Pint는 구성이 필요하지 않으며 라라벨의 독창적인 코딩 스타일을 따라 코드의 코드 스타일 문제를 수정합니다.
파인트는 새로운 라라벨 애플리케이션을 설치하면 자동으로 설치되며, 곧바로 사용할 수 있습니다. 기본적으로 파인트는 어떤 설정도 요구하지 않으며, 라라벨의 고유한 코드 스타일을 따라 당신의 코드를 수정해줄 것입니다.

<a name="installation"></a>
## Installation
## 설치

Pint is included in recent releases of the Laravel framework, so installation is typically unnecessary. However, for older applications, you may install Laravel Pint via Composer:
## 설치

Pint는 라라벨 프레임워크의 최신 릴리스에 포함되어 있으므로 일반적으로 설치가 필요하지 않습니다. 그러나 이전 애플리케이션의 경우 컴포저를 통해 라라벨 Pint를 설치할 수 있습니다.
파인트는 최신 라라벨 프레임워크에 포함되어 있으며, 일반적으로 설치는 불필요합니다. 그러나 이전 버전의 애플리케이션이라면 Composer를 이용하여 설치하여야 합니다.

```shell
composer require laravel/pint --dev
```

<a name="running-pint"></a>
## Running Pint
## Pint 설치하기

You can instruct Pint to fix code style issues by invoking the `pint` binary that is available in your project's `vendor/bin` directory:
## 실행

`.vendor/bin` 프로젝트 디렉토리에서 사용할 수 있는 `pint` 바이너리를 호출하여 Pint가 코드 스타일 문제를 수정하도록 지시할 수 있습니다
당신은 당신의 프로젝트 내 `vendor/bin` 디렉토리에 있는 `pint` 바이너리를 실행하여 파인트로 하여금 코드를 수정할 수 있도록 명령할 수 있습니다.

```shell
./vendor/bin/pint
```

You may also run Pint on specific files or directories:

특정 파일이나 디렉토리에서도 Pint를 실행할 수 있습니다.
또한 당신은 특정 파일이나 디렉토리에 파인트를 실행할 수 있습니다.

```shell
./vendor/bin/pint app/Models

./vendor/bin/pint app/Models/User.php
```

Pint will display a thorough list of all of the files that it updates. You can view even more detail about Pint's changes by providing the `-v` option when invoking Pint:

Pint는 업데이트하는 모든 파일의 전체 목록을 표시합니다. Pint를 호출할 때 `-v` 옵션을 제공하여 Pint의 변경 사항에 대한 자세한 내용을 볼 수 있습니다 .
파인트는 업데이트하고자하는 모든 파일들의 리스트를 보여줄 것입니다. 파인트가 수정하고자 하는 더 자세한 내용을 보고자 한다면 `-v` 옵션을 추가하여 실행해주세요.

```shell
./vendor/bin/pint -v
```

If you would like Pint to simply inspect your code for style errors without actually changing the files, you may use the `--test` option:

Pint가 실제로 파일을 변경하지 않고 코드에서 스타일 오류를 검사하도록 하려면 `--test` 옵션을 사용하면 됩니다.
파인트가 파일 수정 없이 간단하게 코드 스타일 오류를 검사하기를 원한다면, `--test` 옵션을 사용할 수 있습니다.

```shell
./vendor/bin/pint --test
```

If you would like Pint to only modify the files that have uncommitted changes according to Git, you may use the `--dirty` option:

Pint가 Git에 따라 커밋되지 않은 변경 사항이 있는 파일만 수정하도록 하려면 `--dirty` 옵션을 사용하면 됩니다.
Git 상에서 커밋되지 않은 내용만들 수정하고자 한다면, `--dirty` 옵션을 사용하세요

```shell
./vendor/bin/pint --dirty
```

<a name="configuring-pint"></a>
## Configuring Pint
## Pint 설정하기

As previously mentioned, Pint does not require any configuration. However, if you wish to customize the presets, rules, or inspected folders, you may do so by creating a `pint.json` file in your project's root directory:
## 설정

앞서 언급했듯이 Pint는 별다른 설정이 필요하지 않습니다. 하지만 프리셋, 규칙 또는 검사된 폴더를 커스터마이징하려면 프로젝트의 루트 디렉터리에 `pint.json` 파일을 생성해야합니다.
앞서 이야기한 것처럼 파인트는 어떤 설정도 필요로 하지 않습니다. 그러나 프리셋, 규칙, 검사 폴더 등을 수정하고자 한다면, `pint.json` 파일을 루트 디렉토리에 생성하여야 합니다.

```json
{
"preset": "laravel"
"preset": "laravel"
}
```

In addition, if you wish to use a `pint.json` from a specific directory, you may provide the `--config` option when invoking Pint:

또한 `pint.json`를 특정 디렉토리에서 사용하려는 경우 Pint를 호출할 때 `--config` 옵션을 제공할 수 있습니다.
추가로, `pint.json` 파일을 특정 디렉토리에서 이용하고자 한다면, 파인트를 실행할 때 `--config` 옵션을 제공할 수 있습니다.

```shell
pint --config vendor/my-company/coding-style/pint.json
```

<a name="presets"></a>
### Presets
### 프리셋

Presets defines a set of rules that can be used to fix code style issues in your code. By default, Pint uses the `laravel` preset, which fixes issues by following the opinionated coding style of Laravel. However, you may specify a different preset by providing the `--preset` option to Pint:
### 프리셋

사전 설정은 코드 스타일 문제를 수정하는 데 사용할 수 있는 일련의 규칙을 정의합니다. 기본적으로 Pint는 라라벨의 독창적인 코딩 스타일을 따라 문제를 수정하는 `laravel` 사전 설정을 사용합니다. 그러나 Pint에 `--preset` 옵션을 제공하여 다른 사전 설정을 지정할 수 있습니다 .
프리셋은 당신 코드에 있는 스타일 이슈를 수정하는 몇 가지 규칙을 정의합니다. 기본적으로 파인트는 `laravel` 프리셋을 사용하며, 이는 라라벨 특유의 코드 스타일을 준수합니다. 그러나, 당신이 다른 프리셋을 사용하고자 한다면 파인트 사용 시 `--preset` 옵션을 추가해야 합니다.

```shell
pint --preset psr12
```

If you wish, you may also set the preset in your project's `pint.json` file:

원하는 경우 프로젝트 `pint.json` 파일에서 사전 설정을 설정할 수도 있습니다.
원한다면 `pint.json` 파일에 프리셋을 추가할 수도 있습니다.

```json
{
"preset": "psr12"
"preset": "psr12"
}
```

Pint's currently supported presets are: `laravel`, `psr12`, and `symfony`.

Pint의 현재 지원되는 사전 설정은 `laravel`, `psr12`, `symfony` 입니다.
파인트는 현재 `laravel`, `psr12`, `symfony` 프리셋을 지원합니다.

<a name="rules"></a>
### Rules
### 규칙

Rules are style guidelines that Pint will use to fix code style issues in your code. As mentioned above, presets are predefined groups of rules that should be perfect for most PHP projects, so you typically will not need to worry about the individual rules they contain.

규칙은 Pint가 코드 스타일 문제를 수정하는 데 사용할 스타일 지침입니다. 위에서 언급했듯이 사전 설정은 대부분의 PHP 프로젝트에 완벽해야 하는 사전 정의된 규칙 그룹이므로 일반적으로 사전 설정에 포함된 개별 규칙에 대해 걱정할 필요가 없습니다.
### 규칙

However, if you wish, you may enable or disable specific rules in your `pint.json` file:
규칙이란 파인트가 코드를 수정할 때 사용할 스타일 가이드라인입니다. 앞에서 이야기한 것처럼, 프리셋은 많은 PHP 프로젝트에서 사용되기에 최적인 몇 가지 사전 정의된 규칙들이며, 당신은 일반적으로 개별적인 규칙에 대해 걱정할 필요가 없습니다.

그러나 원하는 경우 `pint.json` 파일에서 특정 규칙을 활성화하거나 비활성화할 수 있습니다.
그러나 원한다면, `pint.json` 파일내에서 특정한 규칙을 적용하거나 적용하지 않도록 조정할 수 있습니다..

```json
{
"preset": "laravel",
"rules": {
"simplified_null_return": true,
"braces": false,
"new_with_braces": {
"anonymous_class": false,
"named_class": false
}
}
"preset": "laravel",
"rules": {
"simplified_null_return": true,
"braces": false,
"new_with_braces": {
"anonymous_class": false,
"named_class": false
}
}
}
```

Pint is built on top of [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). Therefore, you may use any of its rules to fix code style issues in your project: [PHP-CS-Fixer Configurator](https://mlocati.github.io/php-cs-fixer-configurator).

Pint는 [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) 위에 구축되었습니다 . 따라서 모든 PHP-CS-Fixer의 규칙을 사용하여 프로젝트의 코드 스타일 문제를 수정할 수 있습니다. [PHP-CS-Fixer 설정기](https://mlocati.github.io/php-cs-fixer-configurator)를 참고하세요.
파인트는 [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)를 기반으로 합니다. 그러므로 PHP-CS-Fixer의 규칙을 준수해야 합니다[PHP-CS-Fixer Configurator](https://mlocati.github.io/php-cs-fixer-configurator).

<a name="excluding-files-or-folders"></a>
### Excluding Files / Folders
### 파일 / 폴더 제외

By default, Pint will inspect all `.php` files in your project except those in the `vendor` directory. If you wish to exclude more folders, you may do so using the `exclude` configuration option:
### 파일/폴더 제외

기본적으로 Pint는 `vendor` 디렉토리에 있는 파일을 제외한 프로젝트의 모든 `.php` 파일을 검사합니다. 더 많은 폴더를 제외하려면 `exclude` 구성 옵션을 사용하여 제외할 수 있습니다.
기본적으로 파인트는 프로젝트 내에 `vendor` 디렉토리를 제외한 모든 `.php` 파일을 검사합니다. 만약 폴더를 제외하고 싶다면, `exclude` 옵션을 이용하세요.

```json
{
"exclude": [
"my-specific/folder"
]
"exclude": ["my-specific/folder"]
}
```

If you wish to exclude all files that contain a given name pattern, you may do so using the `notName` configuration option:

지정된 이름 패턴을 포함하는 모든 파일을 제외하려면 `notName` 구성 옵션을 사용하여 제외할 수 있습니다.
특정 네이밍 패턴을 가진 모든 파일을 제외하고자 한다면, `notName` 옵션을 이용하세요.

```json
{
"notName": [
"*-my-file.php"
]
"notName": ["*-my-file.php"]
}
```

If you would like to exclude a file by providing an exact path to the file, you may do so using the `notPath` configuration option:

파일에 대한 정확한 경로를 제공하여 파일을 제외하려면 `notPath` 구성 옵션을 사용하면 됩니다.
특정 경로의 파일을 제외하고자 한다면, `notPath` 옵션을 이용하세요

```json
{
"notPath": [
"path/to/excluded-file.php"
]
"notPath": ["path/to/excluded-file.php"]
}
```
Loading