Skip to content

Commit

Permalink
Switch to a maintained fork of annotate
Browse files Browse the repository at this point in the history
  • Loading branch information
chvp committed Nov 9, 2024
1 parent 9b4d0ef commit f5aef86
Show file tree
Hide file tree
Showing 19 changed files with 198 additions and 41 deletions.
58 changes: 58 additions & 0 deletions .annotaterb.yml
Original file line number Diff line number Diff line change
@@ -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: true
:show_indexes: true
:simple_indexes: false
:sort: false
: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:
- ''
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ group :development, :test do
end

group :development do
gem 'annotate', '~> 3.2', require: false
gem 'annotaterb', '~> 4.13', require: false
gem 'brakeman', require: false
gem 'rubocop-minitest', '~> 0.36.0', require: false
gem 'rubocop-rails', '~> 2.27', require: false
Expand Down
6 changes: 2 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
annotaterb (4.13.0)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.3.0)
Expand Down Expand Up @@ -326,7 +324,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
annotate (~> 3.2)
annotaterb (~> 4.13)
bootsnap
brakeman
capybara
Expand Down
6 changes: 5 additions & 1 deletion app/models/coder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
# Table name: coders
#
# id :bigint not null, primary key
# avatar_url :string not null
# full_name :string not null
# github_name :string not null
# avatar_url :string not null
# github_url :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_coders_on_github_name (github_name) UNIQUE
#
class Coder < ApplicationRecord
has_many :commits, dependent: :restrict_with_error
has_many :repositories, -> { distinct }, through: :commits
Expand Down
20 changes: 15 additions & 5 deletions app/models/commit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
# Table name: commits
#
# id :bigint not null, primary key
# coder_id :bigint not null
# repository_id :bigint not null
# sha :string not null
# additions :integer not null
# deletions :integer not null
# committed_at :datetime not null
# deletions :integer not null
# score :integer
# sha :string not null
# created_at :datetime not null
# updated_at :datetime not null
# score :integer
# coder_id :bigint not null
# repository_id :bigint not null
#
# Indexes
#
# index_commits_on_coder_id (coder_id)
# index_commits_on_repository_id (repository_id)
#
# Foreign Keys
#
# fk_rails_... (coder_id => coders.id)
# fk_rails_... (repository_id => repositories.id)
#
class Commit < ApplicationRecord
belongs_to :coder, validate: true
Expand Down
13 changes: 11 additions & 2 deletions app/models/git_identity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
# Table name: git_identities
#
# id :bigint not null, primary key
# name :string not null
# email :string not null
# coder_id :bigint not null
# name :string not null
# created_at :datetime not null
# updated_at :datetime not null
# coder_id :bigint not null
#
# Indexes
#
# index_git_identities_on_coder_id (coder_id)
# index_git_identities_on_name_and_email (name,email) UNIQUE
#
# Foreign Keys
#
# fk_rails_... (coder_id => coders.id)
#
class GitIdentity < ApplicationRecord
belongs_to :coder, validate: true
Expand Down
6 changes: 5 additions & 1 deletion app/models/organisation_member.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# Table name: organisation_members
#
# id :bigint not null, primary key
# organisation :string not null
# github_name :string not null
# organisation :string not null
#
# Indexes
#
# index_organisation_members_on_organisation_and_github_name (organisation,github_name) UNIQUE
#
class OrganisationMember < ApplicationRecord
validates :github_name, uniqueness: { scope: :organisation }
Expand Down
10 changes: 7 additions & 3 deletions app/models/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
# Table name: repositories
#
# id :bigint not null, primary key
# clone_url :string not null
# github_url :string not null
# name :string not null
# organisation :string not null
# path :string not null
# github_url :string not null
# clone_url :string not null
# created_at :datetime not null
# updated_at :datetime not null
# organisation :string not null
#
# Indexes
#
# index_repositories_on_organisation_and_name (organisation,name) UNIQUE
#
class Repository < ApplicationRecord
has_many :commits, dependent: :restrict_with_error
Expand Down
8 changes: 8 additions & 0 deletions lib/tasks/annotate_rb.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This rake task was added by annotate_rb gem.

# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
if Rails.env.development? && ENV['ANNOTATERB_SKIP_ON_DB_TASKS'].nil?
require 'annotate_rb'

AnnotateRb::Core.load_rake_tasks
end
6 changes: 5 additions & 1 deletion test/fixtures/coders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
# Table name: coders
#
# id :bigint not null, primary key
# avatar_url :string not null
# full_name :string not null
# github_name :string not null
# avatar_url :string not null
# github_url :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_coders_on_github_name (github_name) UNIQUE
#

one:
full_name: Charlotte Van Petegem
Expand Down
20 changes: 15 additions & 5 deletions test/fixtures/commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
# Table name: commits
#
# id :bigint not null, primary key
# coder_id :bigint not null
# repository_id :bigint not null
# sha :string not null
# additions :integer not null
# deletions :integer not null
# committed_at :datetime not null
# deletions :integer not null
# score :integer
# sha :string not null
# created_at :datetime not null
# updated_at :datetime not null
# score :integer
# coder_id :bigint not null
# repository_id :bigint not null
#
# Indexes
#
# index_commits_on_coder_id (coder_id)
# index_commits_on_repository_id (repository_id)
#
# Foreign Keys
#
# fk_rails_... (coder_id => coders.id)
# fk_rails_... (repository_id => repositories.id)
#

one:
Expand Down
13 changes: 11 additions & 2 deletions test/fixtures/git_identities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
# Table name: git_identities
#
# id :bigint not null, primary key
# name :string not null
# email :string not null
# coder_id :bigint not null
# name :string not null
# created_at :datetime not null
# updated_at :datetime not null
# coder_id :bigint not null
#
# Indexes
#
# index_git_identities_on_coder_id (coder_id)
# index_git_identities_on_name_and_email (name,email) UNIQUE
#
# Foreign Keys
#
# fk_rails_... (coder_id => coders.id)
#

one:
Expand Down
6 changes: 5 additions & 1 deletion test/fixtures/organisation_members.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# Table name: organisation_members
#
# id :bigint not null, primary key
# organisation :string not null
# github_name :string not null
# organisation :string not null
#
# Indexes
#
# index_organisation_members_on_organisation_and_github_name (organisation,github_name) UNIQUE
#

one:
Expand Down
10 changes: 7 additions & 3 deletions test/fixtures/repositories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
# Table name: repositories
#
# id :bigint not null, primary key
# clone_url :string not null
# github_url :string not null
# name :string not null
# organisation :string not null
# path :string not null
# github_url :string not null
# clone_url :string not null
# created_at :datetime not null
# updated_at :datetime not null
# organisation :string not null
#
# Indexes
#
# index_repositories_on_organisation_and_name (organisation,name) UNIQUE
#

one:
Expand Down
6 changes: 5 additions & 1 deletion test/models/coder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
# Table name: coders
#
# id :bigint not null, primary key
# avatar_url :string not null
# full_name :string not null
# github_name :string not null
# avatar_url :string not null
# github_url :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_coders_on_github_name (github_name) UNIQUE
#
require 'test_helper'

class CoderTest < ActiveSupport::TestCase
Expand Down
20 changes: 15 additions & 5 deletions test/models/commit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
# Table name: commits
#
# id :bigint not null, primary key
# coder_id :bigint not null
# repository_id :bigint not null
# sha :string not null
# additions :integer not null
# deletions :integer not null
# committed_at :datetime not null
# deletions :integer not null
# score :integer
# sha :string not null
# created_at :datetime not null
# updated_at :datetime not null
# score :integer
# coder_id :bigint not null
# repository_id :bigint not null
#
# Indexes
#
# index_commits_on_coder_id (coder_id)
# index_commits_on_repository_id (repository_id)
#
# Foreign Keys
#
# fk_rails_... (coder_id => coders.id)
# fk_rails_... (repository_id => repositories.id)
#
require 'test_helper'

Expand Down
13 changes: 11 additions & 2 deletions test/models/git_identity_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
# Table name: git_identities
#
# id :bigint not null, primary key
# name :string not null
# email :string not null
# coder_id :bigint not null
# name :string not null
# created_at :datetime not null
# updated_at :datetime not null
# coder_id :bigint not null
#
# Indexes
#
# index_git_identities_on_coder_id (coder_id)
# index_git_identities_on_name_and_email (name,email) UNIQUE
#
# Foreign Keys
#
# fk_rails_... (coder_id => coders.id)
#
require 'test_helper'

Expand Down
6 changes: 5 additions & 1 deletion test/models/organisation_member_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# Table name: organisation_members
#
# id :bigint not null, primary key
# organisation :string not null
# github_name :string not null
# organisation :string not null
#
# Indexes
#
# index_organisation_members_on_organisation_and_github_name (organisation,github_name) UNIQUE
#
require 'test_helper'

Expand Down
Loading

0 comments on commit f5aef86

Please sign in to comment.