From 54d81b016c33a269fa46fafa004d2129c36007c8 Mon Sep 17 00:00:00 2001 From: Jens Ravens Date: Sat, 23 Nov 2024 13:19:01 +0100 Subject: [PATCH] update annotate --- .annotaterb.yml | 58 ++++++++++++++++++++++++++ Gemfile | 2 +- Gemfile.lock | 6 +-- app/models/daily_nerd_message.rb | 4 +- app/models/inventory.rb | 6 +-- app/models/invoice.rb | 10 ++--- app/models/leave.rb | 6 +-- app/models/payslip.rb | 2 +- app/models/salary.rb | 6 +-- app/models/sprint_feedback.rb | 19 +++++---- app/models/task.rb | 10 ++--- app/models/task_user.rb | 4 +- app/models/time_entry.rb | 18 ++++---- app/models/user.rb | 19 +++++---- bin/{annotate => annotaterb} | 4 +- spec/fixtures/leaves.yml | 6 +-- spec/fixtures/salaries.yml | 6 +-- spec/fixtures/sprint_feedbacks.yml | 19 +++++---- spec/fixtures/task_users.yml | 4 +- spec/fixtures/tasks.yml | 10 ++--- spec/fixtures/time_entries.yml | 18 ++++---- spec/fixtures/users.yml | 19 +++++---- spec/models/daily_nerd_message_spec.rb | 10 +++++ spec/models/leave_spec.rb | 6 +-- spec/models/sprint_feedback_spec.rb | 19 +++++---- spec/models/task_spec.rb | 10 ++--- spec/models/user_spec.rb | 19 +++++---- 27 files changed, 198 insertions(+), 122 deletions(-) create mode 100644 .annotaterb.yml rename bin/{annotate => annotaterb} (84%) diff --git a/.annotaterb.yml b/.annotaterb.yml new file mode 100644 index 00000000..60dd44cc --- /dev/null +++ b/.annotaterb.yml @@ -0,0 +1,58 @@ +--- +:position: before +:position_in_additional_file_patterns: before +:position_in_class: before +:position_in_factory: before +:position_in_fixture: before +:position_in_routes: before +:position_in_serializer: before +:position_in_test: before +:classified_sort: true +:exclude_controllers: true +:exclude_factories: false +:exclude_fixtures: false +:exclude_helpers: true +:exclude_scaffolds: true +:exclude_serializers: false +:exclude_sti_subclasses: false +:exclude_tests: false +:force: false +:format_markdown: false +:format_rdoc: false +:format_yard: false +:frozen: false +:ignore_model_sub_dir: false +:ignore_unknown_models: false +:include_version: false +:show_check_constraints: false +:show_complete_foreign_keys: false +:show_foreign_keys: false +:show_indexes: false +:simple_indexes: false +:sort: true +:timestamp: false +:trace: false +:with_comment: true +:with_column_comments: true +:with_table_comments: true +:active_admin: false +:command: +:debug: false +:hide_default_column_types: '' +:hide_limit_column_types: '' +:ignore_columns: +:ignore_routes: +:models: true +:routes: false +:skip_on_db_migrate: false +:target_action: :do_annotations +:wrapper: +:wrapper_close: +:wrapper_open: +:classes_default_to_s: [] +:additional_file_patterns: [] +:model_dir: + - app/models +:require: [] +:root_dir: + - '' diff --git a/Gemfile b/Gemfile index d34925ca..bcf063b5 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ group :development, :test do end group :development do - gem "annotate" + gem "annotaterb" gem "letter_opener" gem "listen" gem "rb-fsevent" diff --git a/Gemfile.lock b/Gemfile.lock index 7d520303..0e81c714 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,9 +74,7 @@ GEM uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - annotate (2.6.5) - activerecord (>= 2.3.0) - rake (>= 0.8.7) + annotaterb (4.13.0) ast (2.4.2) aws-eventstream (1.3.0) aws-partitions (1.1013.0) @@ -559,7 +557,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - annotate + annotaterb aws-sdk-s3 barnes bcrypt diff --git a/app/models/daily_nerd_message.rb b/app/models/daily_nerd_message.rb index 9cf0b32b..7bd1be90 100644 --- a/app/models/daily_nerd_message.rb +++ b/app/models/daily_nerd_message.rb @@ -5,10 +5,10 @@ # Table name: daily_nerd_messages # # id :uuid not null, primary key -# sprint_feedback_id :uuid not null -# message :string +# message :string not null # created_at :datetime not null # updated_at :datetime not null +# sprint_feedback_id :uuid not null # class DailyNerdMessage < ApplicationRecord belongs_to :sprint_feedback diff --git a/app/models/inventory.rb b/app/models/inventory.rb index ea4dbc62..7752ef34 100644 --- a/app/models/inventory.rb +++ b/app/models/inventory.rb @@ -5,13 +5,13 @@ # Table name: inventories # # id :uuid not null, primary key -# user_id :uuid not null +# details :string +# name :string not null # received_at :datetime not null # returned_at :datetime -# name :string not null -# details :string # created_at :datetime not null # updated_at :datetime not null +# user_id :uuid not null # class Inventory < ApplicationRecord belongs_to :user diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 1677391e..addb1096 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -5,15 +5,15 @@ # Table name: invoices # # id :uuid not null, primary key -# project_id :uuid not null -# harvest_id :bigint not null -# reference :string not null # amount :decimal(, ) not null -# state :string not null -# sent_at :datetime # paid_at :datetime +# reference :string not null +# sent_at :datetime +# state :string not null # created_at :datetime not null # updated_at :datetime not null +# harvest_id :bigint not null +# project_id :uuid not null # class Invoice < ApplicationRecord belongs_to :project diff --git a/app/models/leave.rb b/app/models/leave.rb index da822720..7bde3abf 100644 --- a/app/models/leave.rb +++ b/app/models/leave.rb @@ -5,14 +5,14 @@ # Table name: leaves # # id :uuid not null, primary key +# days :date default([]), not null, is an Array # leave_during :daterange not null +# status :string default("pending_approval"), not null # title :string not null # type :string default("paid"), not null -# status :string default("pending_approval"), not null -# days :date default([]), not null, is an Array -# user_id :uuid not null # created_at :datetime not null # updated_at :datetime not null +# user_id :uuid not null # class Leave < ApplicationRecord diff --git a/app/models/payslip.rb b/app/models/payslip.rb index 9c1559e9..a2033500 100644 --- a/app/models/payslip.rb +++ b/app/models/payslip.rb @@ -6,9 +6,9 @@ # # id :uuid not null, primary key # month :date not null -# user_id :uuid not null # created_at :datetime not null # updated_at :datetime not null +# user_id :uuid not null # class Payslip < ApplicationRecord diff --git a/app/models/salary.rb b/app/models/salary.rb index e4b34830..a425a132 100644 --- a/app/models/salary.rb +++ b/app/models/salary.rb @@ -5,13 +5,13 @@ # Table name: salaries # # id :uuid not null, primary key -# user_id :uuid not null # brut :decimal(, ) not null -# net :decimal(, ) not null # hgf_hash :string +# net :decimal(, ) not null +# valid_from :date not null # created_at :datetime not null # updated_at :datetime not null -# valid_from :date not null +# user_id :uuid not null # class Salary < ApplicationRecord belongs_to :user diff --git a/app/models/sprint_feedback.rb b/app/models/sprint_feedback.rb index b885ece1..5059ae96 100644 --- a/app/models/sprint_feedback.rb +++ b/app/models/sprint_feedback.rb @@ -5,20 +5,21 @@ # Table name: sprint_feedbacks # # id :uuid not null, primary key -# sprint_id :uuid not null -# user_id :uuid not null -# daily_nerd_count :integer -# tracked_hours :decimal(, ) # billable_hours :decimal(, ) -# created_at :datetime not null -# updated_at :datetime not null -# review_notes :string +# costs :decimal(, ) +# daily_nerd_count :integer # daily_nerd_entry_dates :datetime default([]), not null, is an Array +# finished_storypoints :integer default(0), not null # retro_rating :integer # retro_text :string -# finished_storypoints :integer default(0), not null +# review_notes :string +# skip_retro :boolean default(FALSE) +# tracked_hours :decimal(, ) # turnover :decimal(, ) -# costs :decimal(, ) +# created_at :datetime not null +# updated_at :datetime not null +# sprint_id :uuid not null +# user_id :uuid not null # class SprintFeedback < ApplicationRecord diff --git a/app/models/task.rb b/app/models/task.rb index df2c30e0..77793fd0 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -5,16 +5,16 @@ # Table name: tasks # # id :uuid not null, primary key -# sprint_id :uuid -# title :string not null -# status :citext -# github_id :string -# repository :string # issue_number :bigint +# repository :string +# status :citext # story_points :integer +# title :string not null # created_at :datetime not null # updated_at :datetime not null +# github_id :string # project_id :uuid +# sprint_id :uuid # class Task < ApplicationRecord belongs_to :sprint diff --git a/app/models/task_user.rb b/app/models/task_user.rb index 91a91121..57f1a435 100644 --- a/app/models/task_user.rb +++ b/app/models/task_user.rb @@ -5,10 +5,10 @@ # Table name: task_users # # id :uuid not null, primary key -# task_id :uuid not null -# user_id :uuid not null # created_at :datetime not null # updated_at :datetime not null +# task_id :uuid not null +# user_id :uuid not null # class TaskUser < ApplicationRecord belongs_to :task diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index 6b92ab18..bb5a2c81 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -5,23 +5,23 @@ # Table name: time_entries # # id :uuid not null, primary key -# external_id :string -# hours :decimal(, ) not null -# rounded_hours :decimal(, ) not null # billable :string not null -# project_name :string not null -# client_name :string not null -# task :string not null # billable_rate :decimal(, ) +# client_name :string not null # cost_rate :decimal(, ) +# hours :decimal(, ) not null # notes :string -# user_id :uuid not null -# sprint_id :uuid not null +# project_name :string not null +# rounded_hours :decimal(, ) not null +# task :string not null # created_at :datetime not null # updated_at :datetime not null +# external_id :string +# invoice_id :uuid # project_id :uuid +# sprint_id :uuid not null # task_id :uuid -# invoice_id :uuid +# user_id :uuid not null # class TimeEntry < ApplicationRecord diff --git a/app/models/user.rb b/app/models/user.rb index 67632a1c..cebe3466 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,21 +5,22 @@ # Table name: users # # id :uuid not null, primary key +# born_on :date # email :string default(""), not null -# roles :string default([]), not null, is an Array # encrypted_password :string default(""), not null -# reset_password_token :string -# reset_password_sent_at :datetime +# first_name :string +# github_handle :string +# hired_on :date +# last_name :string +# nick_name :string # remember_created_at :datetime +# reset_password_sent_at :datetime +# reset_password_token :string +# roles :string default([]), not null, is an Array +# yearly_holidays :integer default(30), not null # created_at :datetime not null # updated_at :datetime not null -# first_name :string -# last_name :string # slack_id :string -# born_on :date -# hired_on :date -# github_handle :string -# nick_name :string # class User < ApplicationRecord diff --git a/bin/annotate b/bin/annotaterb similarity index 84% rename from bin/annotate rename to bin/annotaterb index bfae06c9..d8f90cf1 100755 --- a/bin/annotate +++ b/bin/annotaterb @@ -15,7 +15,7 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", bundle_binstub = File.expand_path("../bundle", __FILE__) if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") load(bundle_binstub) else abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. @@ -26,4 +26,4 @@ end require "rubygems" require "bundler/setup" -load Gem.bin_path("annotate", "annotate") +load Gem.bin_path("annotaterb", "annotaterb") diff --git a/spec/fixtures/leaves.yml b/spec/fixtures/leaves.yml index 62126ffc..f796bf31 100644 --- a/spec/fixtures/leaves.yml +++ b/spec/fixtures/leaves.yml @@ -3,14 +3,14 @@ # Table name: leaves # # id :uuid not null, primary key +# days :date default([]), not null, is an Array # leave_during :daterange not null +# status :string default("pending_approval"), not null # title :string not null # type :string default("paid"), not null -# status :string default("pending_approval"), not null -# days :date default([]), not null, is an Array -# user_id :uuid not null # created_at :datetime not null # updated_at :datetime not null +# user_id :uuid not null # john_sick_leave: title: Having the Flu diff --git a/spec/fixtures/salaries.yml b/spec/fixtures/salaries.yml index c66c9a39..8094e22a 100644 --- a/spec/fixtures/salaries.yml +++ b/spec/fixtures/salaries.yml @@ -3,13 +3,13 @@ # Table name: salaries # # id :uuid not null, primary key -# user_id :uuid not null # brut :decimal(, ) not null -# net :decimal(, ) not null # hgf_hash :string +# net :decimal(, ) not null +# valid_from :date not null # created_at :datetime not null # updated_at :datetime not null -# valid_from :date not null +# user_id :uuid not null # john_old: diff --git a/spec/fixtures/sprint_feedbacks.yml b/spec/fixtures/sprint_feedbacks.yml index 8e0cebc8..79781b5e 100644 --- a/spec/fixtures/sprint_feedbacks.yml +++ b/spec/fixtures/sprint_feedbacks.yml @@ -3,18 +3,21 @@ # Table name: sprint_feedbacks # # id :uuid not null, primary key -# sprint_id :uuid not null -# user_id :uuid not null -# daily_nerd_count :integer -# tracked_hours :decimal(, ) # billable_hours :decimal(, ) -# created_at :datetime not null -# updated_at :datetime not null -# review_notes :string +# costs :decimal(, ) +# daily_nerd_count :integer # daily_nerd_entry_dates :datetime default([]), not null, is an Array # finished_storypoints :integer default(0), not null +# retro_rating :integer +# retro_text :string +# review_notes :string +# skip_retro :boolean default(FALSE) +# tracked_hours :decimal(, ) # turnover :decimal(, ) -# costs :decimal(, ) +# created_at :datetime not null +# updated_at :datetime not null +# sprint_id :uuid not null +# user_id :uuid not null # sprint_feedback_john: sprint: empty diff --git a/spec/fixtures/task_users.yml b/spec/fixtures/task_users.yml index b5204143..b4e24d52 100644 --- a/spec/fixtures/task_users.yml +++ b/spec/fixtures/task_users.yml @@ -3,10 +3,10 @@ # Table name: task_users # # id :uuid not null, primary key -# task_id :uuid not null -# user_id :uuid not null # created_at :datetime not null # updated_at :datetime not null +# task_id :uuid not null +# user_id :uuid not null # task_user_1: diff --git a/spec/fixtures/tasks.yml b/spec/fixtures/tasks.yml index 941ffe80..3011194f 100644 --- a/spec/fixtures/tasks.yml +++ b/spec/fixtures/tasks.yml @@ -3,16 +3,16 @@ # Table name: tasks # # id :uuid not null, primary key -# sprint_id :uuid -# title :string not null -# status :citext -# github_id :string -# repository :string # issue_number :bigint +# repository :string +# status :citext # story_points :integer +# title :string not null # created_at :datetime not null # updated_at :datetime not null +# github_id :string # project_id :uuid +# sprint_id :uuid # done: diff --git a/spec/fixtures/time_entries.yml b/spec/fixtures/time_entries.yml index 8e5f0f3d..3abf0715 100644 --- a/spec/fixtures/time_entries.yml +++ b/spec/fixtures/time_entries.yml @@ -3,23 +3,23 @@ # Table name: time_entries # # id :uuid not null, primary key -# external_id :string -# hours :decimal(, ) not null -# rounded_hours :decimal(, ) not null # billable :string not null -# project_name :string not null -# client_name :string not null -# task :string not null # billable_rate :decimal(, ) +# client_name :string not null # cost_rate :decimal(, ) +# hours :decimal(, ) not null # notes :string -# user_id :uuid not null -# sprint_id :uuid not null +# project_name :string not null +# rounded_hours :decimal(, ) not null +# task :string not null # created_at :datetime not null # updated_at :datetime not null +# external_id :string +# invoice_id :uuid # project_id :uuid +# sprint_id :uuid not null # task_id :uuid -# invoice_id :uuid +# user_id :uuid not null # entry_1: diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index 8c06c1a7..c0cb0d29 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -3,21 +3,22 @@ # Table name: users # # id :uuid not null, primary key +# born_on :date # email :string default(""), not null -# roles :string default([]), not null, is an Array # encrypted_password :string default(""), not null -# reset_password_token :string -# reset_password_sent_at :datetime +# first_name :string +# github_handle :string +# hired_on :date +# last_name :string +# nick_name :string # remember_created_at :datetime +# reset_password_sent_at :datetime +# reset_password_token :string +# roles :string default([]), not null, is an Array +# yearly_holidays :integer default(30), not null # created_at :datetime not null # updated_at :datetime not null -# first_name :string -# last_name :string # slack_id :string -# born_on :date -# hired_on :date -# github_handle :string -# nick_name :string # john: &john email: john@example.com diff --git a/spec/models/daily_nerd_message_spec.rb b/spec/models/daily_nerd_message_spec.rb index f2f18198..01f70e3e 100644 --- a/spec/models/daily_nerd_message_spec.rb +++ b/spec/models/daily_nerd_message_spec.rb @@ -1,5 +1,15 @@ # frozen_string_literal: true +# == Schema Information +# +# Table name: daily_nerd_messages +# +# id :uuid not null, primary key +# message :string not null +# created_at :datetime not null +# updated_at :datetime not null +# sprint_feedback_id :uuid not null +# require "rails_helper" RSpec.describe DailyNerdMessage do diff --git a/spec/models/leave_spec.rb b/spec/models/leave_spec.rb index bfd1b6e1..bb1f6ac5 100644 --- a/spec/models/leave_spec.rb +++ b/spec/models/leave_spec.rb @@ -5,14 +5,14 @@ # Table name: leaves # # id :uuid not null, primary key +# days :date default([]), not null, is an Array # leave_during :daterange not null +# status :string default("pending_approval"), not null # title :string not null # type :string default("paid"), not null -# status :string default("pending_approval"), not null -# days :date default([]), not null, is an Array -# user_id :uuid not null # created_at :datetime not null # updated_at :datetime not null +# user_id :uuid not null # require "rails_helper" diff --git a/spec/models/sprint_feedback_spec.rb b/spec/models/sprint_feedback_spec.rb index 32b49b92..5315e6ad 100644 --- a/spec/models/sprint_feedback_spec.rb +++ b/spec/models/sprint_feedback_spec.rb @@ -5,18 +5,21 @@ # Table name: sprint_feedbacks # # id :uuid not null, primary key -# sprint_id :uuid not null -# user_id :uuid not null -# daily_nerd_count :integer -# tracked_hours :decimal(, ) # billable_hours :decimal(, ) -# created_at :datetime not null -# updated_at :datetime not null -# review_notes :string +# costs :decimal(, ) +# daily_nerd_count :integer # daily_nerd_entry_dates :datetime default([]), not null, is an Array # finished_storypoints :integer default(0), not null +# retro_rating :integer +# retro_text :string +# review_notes :string +# skip_retro :boolean default(FALSE) +# tracked_hours :decimal(, ) # turnover :decimal(, ) -# costs :decimal(, ) +# created_at :datetime not null +# updated_at :datetime not null +# sprint_id :uuid not null +# user_id :uuid not null # require "rails_helper" diff --git a/spec/models/task_spec.rb b/spec/models/task_spec.rb index 9cc15c3a..2e026682 100644 --- a/spec/models/task_spec.rb +++ b/spec/models/task_spec.rb @@ -5,16 +5,16 @@ # Table name: tasks # # id :uuid not null, primary key -# sprint_id :uuid -# title :string not null -# status :citext -# github_id :string -# repository :string # issue_number :bigint +# repository :string +# status :citext # story_points :integer +# title :string not null # created_at :datetime not null # updated_at :datetime not null +# github_id :string # project_id :uuid +# sprint_id :uuid # require "rails_helper" diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 12d11657..9278b6ba 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -5,21 +5,22 @@ # Table name: users # # id :uuid not null, primary key +# born_on :date # email :string default(""), not null -# roles :string default([]), not null, is an Array # encrypted_password :string default(""), not null -# reset_password_token :string -# reset_password_sent_at :datetime +# first_name :string +# github_handle :string +# hired_on :date +# last_name :string +# nick_name :string # remember_created_at :datetime +# reset_password_sent_at :datetime +# reset_password_token :string +# roles :string default([]), not null, is an Array +# yearly_holidays :integer default(30), not null # created_at :datetime not null # updated_at :datetime not null -# first_name :string -# last_name :string # slack_id :string -# born_on :date -# hired_on :date -# github_handle :string -# nick_name :string # require "rails_helper"