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

[pre-commit.ci] pre-commit autoupdate #7064

Merged
merged 5 commits into from
May 11, 2024
Merged
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
exclude: |
Expand All @@ -15,7 +15,7 @@ repos:
- id: prettier
types_or: [javascript, jsx, css, scss, html]
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v16.3.1
rev: v16.5.0
hooks:
- id: stylelint
additional_dependencies: [
Expand All @@ -32,7 +32,7 @@ repos:
app/assets/stylesheets/common/_reset.scss
)$
- repo: https://github.com/rubocop/rubocop
rev: v1.62.1
rev: v1.63.4
hooks:
- id: rubocop
args: ["--autocorrect"]
Expand Down
1 change: 1 addition & 0 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends: ["stylelint-config-sass-guidelines"]
rules:
scss/at-extend-no-missing-placeholder: null
scss/no-global-function-names: null
max-nesting-depth: 4
selector-class-pattern: null
selector-max-compound-selectors: 6
Expand Down
13 changes: 6 additions & 7 deletions app/controllers/assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,12 @@ def populate_starter_file_manager
flash_message(:warning,
I18n.t('assignments.starter_file.groupings_exist_warning_html'))
end
file_data = []
assignment.starter_file_groups.order(:id).each do |g|
file_data << { id: g.id,
name: g.name,
entry_rename: g.entry_rename,
use_rename: g.use_rename,
files: starter_file_group_file_data(g) }
file_data = assignment.starter_file_groups.order(:id).map do |g|
{ id: g.id,
name: g.name,
entry_rename: g.entry_rename,
use_rename: g.use_rename,
files: starter_file_group_file_data(g) }
end
section_data = current_course.sections
.left_outer_joins(:starter_file_groups)
Expand Down
15 changes: 7 additions & 8 deletions app/models/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,14 @@ def export_student_data_csv
end

def export_student_data_yml
output = []
students = self.students.joins(:user).order('users.user_name').includes(:section)
students.each do |student|
output.push(user_name: student.user_name,
last_name: student.last_name,
first_name: student.first_name,
email: student.email,
id_number: student.id_number,
section_name: student.section&.name)
output = students.map do |student|
{ user_name: student.user_name,
last_name: student.last_name,
first_name: student.first_name,
email: student.email,
id_number: student.id_number,
section_name: student.section&.name }
end
output.to_yaml
end
Expand Down
5 changes: 2 additions & 3 deletions app/models/grade_entry_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ def count_non_nil

# Create grade_entry_student for each student in the course
def create_all_grade_entry_students
new_data = []
course.students.each do |student|
new_data << { role_id: student.id, assessment_id: id, released_to_student: false }
new_data = course.students.map do |student|
{ role_id: student.id, assessment_id: id, released_to_student: false }
end
GradeEntryStudent.insert_all(new_data, returning: false) unless new_data.empty?
end
Expand Down
5 changes: 2 additions & 3 deletions spec/controllers/assignments_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2064,9 +2064,8 @@

it 'copies over starter files' do
uploaded_assignment = Assignment.find_by(short_identifier: assignment.short_identifier)
uploaded_starter_files = []
uploaded_assignment.starter_file_groups.each do |group|
uploaded_starter_files << {
uploaded_starter_files = uploaded_assignment.starter_file_groups.map do |group|
{
name: group.name,
use_rename: group.use_rename,
entry_rename: group.entry_rename,
Expand Down
9 changes: 4 additions & 5 deletions spec/factories/grade_entry_forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
factory :grade_entry_form_with_multiple_grade_entry_items, parent: :grade_entry_form do
sequence(:short_identifier) { |i| "Spreadsheet_#{i}_with_data" }
after(:create) do |grade_entry_form_with_multiple_grade_entry_items|
grade_entry_items = []
(1..3).each do |i|
grade_entry_items << create(:grade_entry_item,
grade_entry_form: grade_entry_form_with_multiple_grade_entry_items,
out_of: 10, position: i)
grade_entry_items = (1..3).map do |i|
create(:grade_entry_item,
grade_entry_form: grade_entry_form_with_multiple_grade_entry_items,
out_of: 10, position: i)
end
grade_entry_form_with_multiple_grade_entry_items.grade_entry_items = grade_entry_items
end
Expand Down
5 changes: 1 addition & 4 deletions spec/models/annotation_category_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,7 @@
create(:annotation_text, annotation_category: annotation_category)
create(:annotation_text, annotation_category: annotation_category)
annotation_category.update!(flexible_criterion_id: flex_criterion.id)
annotation_text_deductions = []
annotation_category.annotation_texts.each do |text|
annotation_text_deductions << text.deduction
end
annotation_text_deductions = annotation_category.annotation_texts.map(&:deduction)
expect(annotation_text_deductions).to all(eq(0.0))
end
end
Expand Down
Loading