Skip to content

Commit 52c1abb

Browse files
Merge branch 'faker-ruby:main' into master
2 parents ad40fb8 + 717f6e0 commit 52c1abb

File tree

731 files changed

+216764
-8519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

731 files changed

+216764
-8519
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug Report
33
about: Create a bug report
44
title: "Issue title goes here"
5-
labels: needs-triage
5+
labels: "🐞 Issue: Bug"
66
assignees: ''
77

88
---
@@ -11,10 +11,39 @@ assignees: ''
1111
A clear and concise description of what the bug is.
1212

1313
## To Reproduce
14-
Describe the steps to reproduce the behavior.
14+
Describe a way to reproduce your bug. To get the Faker version, run `Faker::VERSION`.
15+
16+
Use the reproduction script below to reproduce the issue:
17+
18+
```
19+
# frozen_string_literal: true
20+
21+
require "bundler/inline"
22+
23+
gemfile(true) do
24+
source "https://rubygems.org"
25+
26+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
27+
28+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
29+
gem "minitest"
30+
end
31+
32+
require "minitest/autorun"
33+
34+
class BugTest < Minitest::Test
35+
def test_faker
36+
# CHANGEME - Reproduce the issue here. Here's an example:
37+
@tester = Faker::TvShows::SiliconValley
38+
refute_empty @tester.company
39+
assert @tester.company == "Intersite"
40+
end
41+
end
42+
43+
```
1544

1645
## Expected behavior
1746
A clear and concise description of what you expected to happen.
1847

1948
## Additional context
20-
Add any other context about the problem here.
49+
Add any other additional information about the problem here.

.github/ISSUE_TEMPLATE/feature-request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,48 @@
1-
Issue#
2-
------
1+
<!--
2+
Thanks for contributing to faker-ruby!
33
4-
Example:
4+
Please do not make *Draft* pull requests, as they still send
5+
notifications to everyone watching the faker-ruby repo.
56
6-
https://github.com/faker-ruby/faker/issues/XXX
7+
Create a pull request when it is ready for review and feedback
8+
from the faker-ruby team :).
79
8-
OR
10+
If your pull request affects documentation or any non-code
11+
changes, guidelines for those changes are [available
12+
here](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md#documentation).
913
10-
`No-Story`
14+
About this template
1115
12-
Description:
13-
------
14-
*Describe what this PR does in a few lines. If you are adding a new faker generator, please tell us how you're going to use this object. Use cases are important because we need to make sure that our faker generators are useful. After adding the description, please delete this line.*
16+
The following template aims to help contributors write a good description for their pull requests.
17+
We'd like you to provide a description of the changes in your pull request (i.e. bugs fixed or features added), motivation behind the changes, and complete the checklist below before opening a pull request.
18+
19+
Feel free to discard it if you need to (e.g. when you just fix a typo). -->
20+
21+
### Motivation / Background
22+
23+
<!--
24+
Describe why this Pull Request needs to be merged. What bug have you fixed? Why is it important?
25+
If you are fixing a specific issue, include "Fixes #ISSUE" (replace with the issue number, remove the quotes) and the issue will be linked to this PR.
26+
27+
If you're proposing a new generator or locale, please review and follow the [Contributing guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md) first.
28+
-->
29+
30+
This Pull Request has been created because [REPLACE ME].
31+
32+
### Additional information
33+
34+
<!-- Provide additional information such as benchmarks, reference to other repositories or alternative solutions. -->
35+
36+
### Checklist
37+
38+
Before submitting the PR make sure the following are checked:
39+
40+
* [ ] This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
41+
* [ ] Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: `[Fix #issue-number]`
42+
* [ ] Tests are added or updated if you fix a bug, refactor something, or add a feature.
43+
* [ ] Tests and Rubocop are passing before submitting your proposed changes.
44+
45+
If you're proposing a new generator or locale:
46+
47+
* [ ] Double-check the existing generators documentation to make sure the new generator you want to add doesn't already exist.
48+
* [ ] You've reviewed and followed the [Contributing guidelines](https://github.com/faker-ruby/faker/blob/main/CONTRIBUTING.md).

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+

.github/workflows/codeql.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "CodeQL"
2+
3+
on:
4+
schedule:
5+
- cron: '56 11 * * 5'
6+
7+
jobs:
8+
analyze:
9+
name: Analyze
10+
runs-on: [ubuntu-latest]
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
language: [ 'ruby' ]
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
# Initializes the CodeQL tools for scanning.
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@v2
28+
with:
29+
languages: ${{ matrix.language }}
30+
# If you wish to specify custom queries, you can do so here or in a config file.
31+
# By default, queries listed here will override any specified in a config file.
32+
# Prefix the list here with "+" to use these queries and those in the config file.
33+
34+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
35+
# queries: security-extended,security-and-quality
36+
37+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
38+
# If this step fails, then you should remove it and run the build manually (see below)
39+
- name: Autobuild
40+
uses: github/codeql-action/autobuild@v2
41+
42+
# ℹ️ Command-line programs to run using the OS shell.
43+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
44+
45+
# If the Autobuild fails above, remove it and uncomment the following three lines.
46+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
47+
48+
# - run: |
49+
# echo "Run, Build Application using script"
50+
# ./location_of_script_within_repo/buildscript.sh
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@v2
54+
with:
55+
category: "/language:${{matrix.language}}"

.github/workflows/push_gem.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Push Gem
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
push:
11+
if: github.repository == 'faker-ruby/faker'
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
id-token: write
17+
18+
steps:
19+
# Set up
20+
- name: Harden Runner
21+
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
22+
with:
23+
egress-policy: audit
24+
25+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
26+
- name: Set up Ruby
27+
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
28+
with:
29+
bundler-cache: true
30+
ruby-version: ruby
31+
32+
# Release
33+
- uses: rubygems/release-gem@612653d273a73bdae1df8453e090060bb4db5f31 # v1

.github/workflows/ruby.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,64 @@ name: Tests
99

1010
on:
1111
push:
12-
branches: [ master ]
12+
branches: [ main ]
1313
pull_request:
14-
branches: [ master ]
14+
branches: [ main ]
15+
16+
permissions:
17+
contents: read
1518

1619
jobs:
1720
lint:
18-
name: Rubocop
21+
name: RuboCop
1922
runs-on: ubuntu-latest
2023
steps:
21-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
2225
- uses: ruby/setup-ruby@v1
2326
with:
2427
ruby-version: '2.7'
2528

2629
- name: Install dependencies
2730
run: bundle install
2831

29-
- name: Run Rubocop
32+
- name: Run RuboCop
3033
run: bundle exec rake rubocop
31-
test:
34+
test:
3235
name: Ruby ${{ matrix.ruby }}
3336
runs-on: ubuntu-latest
3437
strategy:
3538
fail-fast: false # don't fail all matrix builds if one fails
3639
matrix:
3740
ruby:
38-
- '2.5'
39-
- '2.6'
4041
- '2.7'
42+
- '3.0'
43+
- '3.1'
44+
- '3.2'
45+
- '3.3'
4146
- 'head'
4247
- truffleruby-head
4348
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
4449
steps:
45-
- uses: actions/checkout@v2
50+
- uses: actions/checkout@v3
4651
- uses: ruby/setup-ruby@v1
4752
with:
4853
ruby-version: ${{ matrix.ruby }}
4954

5055
- name: Install dependencies
5156
run: bundle install
52-
57+
5358
- name: Setup Code Climate test-reporter
5459
run: |
5560
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
5661
chmod +x ./cc-test-reporter
5762
./cc-test-reporter before-build
58-
63+
5964
- name: Run tests
6065
run: bundle exec rake test
6166

6267
- name: Publish code coverage
6368
env:
6469
CC_TEST_REPORTER_ID: c9b8356df2031a5a72462555fe898245cf24d83c7bb82c40ddb5c6c6976c4319
65-
# CC_TEST_REPORTER_ID: ${{ secrets.CodeClimateReporterId }}
6670
run: |
6771
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
6872
./cc-test-reporter after-build -r $CC_TEST_REPORTER_ID

.rubocop.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
require:
2+
- rubocop-minitest
3+
- rubocop-rake
4+
15
AllCops:
2-
TargetRubyVersion: 2.5
6+
TargetRubyVersion: 2.7
7+
NewCops: enable
8+
9+
# Suppress noise for obvious operator precedence.
10+
Lint/AmbiguousOperatorPrecedence:
11+
Description: Checks for expressions containing multiple binary operations with ambiguous precedence.
12+
Enabled: false
313

414
Layout/LineLength:
515
Description: This cop checks the length of lines in the source code. The maximum length is configurable.
@@ -36,6 +46,10 @@ Metrics/PerceivedComplexity:
3646
Enabled: false
3747
Max: 7
3848

49+
Naming/VariableNumber:
50+
Description: Use the configured style when numbering symbols, methods and variables.
51+
Enabled: false
52+
3953
Style/AsciiComments:
4054
Description: This cop checks for non-ascii (non-English) characters in comments.
4155
Exclude:
@@ -49,6 +63,10 @@ Style/Documentation:
4963
Description: This cop checks for missing top-level documentation of classes and modules.
5064
Enabled: false
5165

66+
Style/DocumentDynamicEvalDefinition:
67+
Description: When using `class_eval` (or other `eval`) with string interpolation, add a comment block showing its appearance if interpolated.
68+
Enabled: false
69+
5270
Style/EvalWithLocation:
5371
Description: This cop checks eval method usage. eval can receive source location metadata, that are filename and line number.
5472
Exclude:
@@ -91,3 +109,7 @@ Security/Eval:
91109
Description: The use of eval represents a serious security risk.
92110
Exclude:
93111
- 'lib/faker/default/json.rb'
112+
113+
Style/IfUnlessModifier:
114+
Description: Checks for `if` and `unless` statements that would fit on one line if written as modifier `if`/`unless`. The cop also checks for modifier `if`/`unless` lines that exceed the maximum line length.
115+
Enabled: false

0 commit comments

Comments
 (0)