scrum_lint 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 713f645a6fa0f2c33084d44f74a605ec0fe58266
4
+ data.tar.gz: 2852c9b789f35bb7e89cfd811c94fa199eebadfd
5
+ SHA512:
6
+ metadata.gz: 1cdc0fdb95cae70b269bd36e339bc8d8ac8a5b7105490a5a96e7286e64736ad1b2842f0c70b3b2a552aee2727f313b6a13b2f19d647ccc821e5250839e1089e7
7
+ data.tar.gz: 5a4d08158dc6178d70ac68fa3d2368660a7f32f88e8366dd754aec5de66c4eebdf6110b2d4d3929a74265a5c8f7800f5b319b007c49ed4ba8127a40ca3c7ad02
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at robert@chalkschools.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Robert Fletcher
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # ScrumLint
2
+
3
+ ScrumLint is a tool to manage Chalk's development workflow in Trello and
4
+ Github. It provides feedback based on actions that need to be taken to keep our
5
+ boards in sync with what is actually happening.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ gem install scrum_lint
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ScrumLint expects the environment variables `TRELLO_DEVELOPER_PUBLIC_KEY` and
16
+ `TRELLO_MEMBER_TOKEN` to be set in order to work. You can see how to acquire
17
+ these tokens in the [Basic authorization section of the `ruby-trello`
18
+ gem](https://github.com/jeremytregunna/ruby-trello#basic-authorization). Once
19
+ you've set these, you can run the following command for a list of corrections
20
+ to be made:
21
+
22
+ ```sh
23
+ scrum-lint
24
+ ```
25
+
26
+ Running ScrumLint will run a series of checks against your Trello board to
27
+ ensure it is up to date, and list out any violations.
28
+
29
+ ## Linters
30
+
31
+ ### Context
32
+
33
+ The Context linter checks that each card in task lists has a context listed at
34
+ the beginning of it's description. This is expected to be a text label in the
35
+ format:
36
+
37
+ ```
38
+ Context: https://trello.com/c/<some_card_hash>
39
+ ```
40
+
41
+ ## Development
42
+
43
+ After checking out the repo, run `script/setup` to install dependencies. Then,
44
+ run `rake spec` to run the tests. You can also run `script/console` for an
45
+ interactive prompt that will allow you to experiment.
46
+
47
+ To install this gem onto your local machine, run `bundle exec rake install`. To
48
+ release a new version, update the version number in `version.rb`, and then run
49
+ `bundle exec rake release`, which will create a git tag for the version, push
50
+ git commits and tags, and push the `.gem` file to
51
+ [rubygems.org](https://rubygems.org).
52
+
53
+ ## Contributing
54
+
55
+ Bug reports and pull requests are welcome on GitHub at
56
+ https://github.com/[USERNAME]/scrum_lint. This project is intended to be a
57
+ safe, welcoming space for collaboration, and contributors are expected to
58
+ adhere to the [Contributor Covenant](http://contributor-covenant.org) code of
59
+ conduct.
60
+
61
+
62
+ ## License
63
+
64
+ The gem is available as open source under the terms of the [MIT
65
+ License](http://opensource.org/licenses/MIT).
data/exe/scrum-lint ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/scrum_lint'
4
+
5
+ ScrumLint::Runner.()
@@ -0,0 +1,24 @@
1
+ module ScrumLint
2
+
3
+ class BoardValidator
4
+ def self.call(board)
5
+ new.(board)
6
+ end
7
+
8
+ def call(board)
9
+ fail "no task lists found!" unless board.task_lists.any?
10
+ extra_list_names = board.lists.map(&:name) - expected_list_names(board)
11
+ warn "extra lists found: #{extra_list_names}" if extra_list_names.any?
12
+ end
13
+
14
+ private
15
+
16
+ def expected_list_names(board)
17
+ ScrumLint.config.project_list_names +
18
+ ScrumLint.config.task_list_names +
19
+ board.done_lists.map(&:name) +
20
+ ScrumLint.config.ignored_list_names
21
+ end
22
+ end
23
+
24
+ end
@@ -0,0 +1,27 @@
1
+ module ScrumLint
2
+
3
+ class ContextChecker
4
+
5
+ def self.call(board)
6
+ new.(board)
7
+ end
8
+
9
+ def call(board)
10
+ board.task_lists.each do |list|
11
+ cards = cards_without_context(list)
12
+ if cards.any?
13
+ puts "List #{list.name.green} has cards missing context:"
14
+ cards.each { |card| puts "-> #{card.name.blue}" }
15
+ end
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def cards_without_context(list)
22
+ list.cards.select { |card| !card.desc.match(/^Context:/) }
23
+ end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,17 @@
1
+ module ScrumLint
2
+
3
+ module Configuration
4
+ def self.new
5
+ OpenStruct.new(
6
+ board_name: 'Eng: Current',
7
+ task_list_names: ['Planned', 'This Sprint', 'Doing', 'In Review'],
8
+ done_list_matcher: /^Done.*$/,
9
+ project_list_names: ['Active Projects'],
10
+ ignored_list_names: %w(Emergent),
11
+ trello_developer_public_key: ENV.fetch('TRELLO_DEVELOPER_PUBLIC_KEY'),
12
+ trello_member_token: ENV.fetch('TRELLO_MEMBER_TOKEN'),
13
+ )
14
+ end
15
+ end
16
+
17
+ end
@@ -0,0 +1,24 @@
1
+ module ScrumLint
2
+
3
+ class Configurator
4
+
5
+ def self.call
6
+ Trello.configure do |trello_config|
7
+ trello_config.developer_public_key = trello_developer_public_key
8
+ trello_config.member_token = trello_member_token
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def self.trello_developer_public_key
15
+ ScrumLint.config.trello_developer_public_key
16
+ end
17
+
18
+ def self.trello_member_token
19
+ ScrumLint.config.trello_member_token
20
+ end
21
+
22
+ end
23
+
24
+ end
@@ -0,0 +1,35 @@
1
+ require_relative 'list'
2
+
3
+ module ScrumLint
4
+
5
+ class Board
6
+ attr_accessor :trello_board
7
+
8
+ def initialize(trello_board)
9
+ self.trello_board = trello_board
10
+ end
11
+
12
+ def lists
13
+ @lists ||= trello_board.lists.map { |list| ScrumLint::List.new(list) }
14
+ end
15
+
16
+ def done_lists
17
+ @done_lists ||= lists.select { |list| done_list_name?(list.name) }
18
+ end
19
+
20
+ def task_lists
21
+ @task_lists ||= lists.select { |list| task_list_name?(list.name) }
22
+ end
23
+
24
+ private
25
+
26
+ def task_list_name?(name)
27
+ ScrumLint.config.task_list_names.include?(name) # || done_list_name?(name)
28
+ end
29
+
30
+ def done_list_name?(name)
31
+ name.match(ScrumLint.config.done_list_matcher)
32
+ end
33
+ end
34
+
35
+ end
@@ -0,0 +1,22 @@
1
+ module ScrumLint
2
+
3
+ class Card
4
+
5
+ attr_accessor :trello_card, :list
6
+
7
+ def initialize(trello_card, list:)
8
+ self.trello_card = trello_card
9
+ self.list = list
10
+ end
11
+
12
+ def desc
13
+ trello_card.desc
14
+ end
15
+
16
+ def name
17
+ trello_card.name
18
+ end
19
+
20
+ end
21
+
22
+ end
@@ -0,0 +1,25 @@
1
+ require_relative 'card'
2
+
3
+ module ScrumLint
4
+
5
+ class List
6
+
7
+ attr_accessor :trello_list
8
+
9
+ def initialize(trello_list)
10
+ self.trello_list = trello_list
11
+ end
12
+
13
+ def name
14
+ trello_list.name
15
+ end
16
+
17
+ def cards
18
+ @cards ||= trello_list.cards.map do |card|
19
+ ScrumLint::Card.new(card, list: self)
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ end
@@ -0,0 +1,41 @@
1
+ require_relative 'configurator'
2
+ require_relative 'models/board'
3
+ require_relative 'board_validator'
4
+ require_relative 'checkers/context_checker'
5
+
6
+ module ScrumLint
7
+
8
+ class Runner
9
+ def self.call
10
+ new.()
11
+ end
12
+
13
+ def call
14
+ ScrumLint::Configurator.()
15
+ ScrumLint::BoardValidator.(board)
16
+ ScrumLint::ContextChecker.(board)
17
+ end
18
+
19
+ private
20
+
21
+ def board
22
+ @board ||= ScrumLint::Board.new(locate_board)
23
+ end
24
+
25
+ def locate_board
26
+ matching_boards = boards.select { |board| board.name == board_name }
27
+ fail 'multiple boards match' if matching_boards.size > 1
28
+ matching_boards.first
29
+ end
30
+
31
+ def boards
32
+ Trello::Board.all
33
+ end
34
+
35
+ def board_name
36
+ ScrumLint.config.board_name
37
+ end
38
+
39
+ end
40
+
41
+ end
@@ -0,0 +1,3 @@
1
+ module ScrumLint
2
+ VERSION = '0.0.1'
3
+ end
data/lib/scrum_lint.rb ADDED
@@ -0,0 +1,15 @@
1
+ require 'trello'
2
+ require 'colorize'
3
+ require 'byebug'
4
+
5
+ require_relative 'scrum_lint/version'
6
+ require_relative 'scrum_lint/configuration'
7
+ require_relative 'scrum_lint/runner'
8
+
9
+ module ScrumLint
10
+
11
+ def self.config
12
+ @config ||= ScrumLint::Configuration.new
13
+ end
14
+
15
+ end
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scrum_lint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Robert Fletcher
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-02-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby-trello
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: colorize
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.11'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '8.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '8.2'
97
+ description:
98
+ email:
99
+ - robert@chalkschools.com
100
+ executables:
101
+ - scrum-lint
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - CODE_OF_CONDUCT.md
106
+ - LICENSE.txt
107
+ - README.md
108
+ - exe/scrum-lint
109
+ - lib/scrum_lint.rb
110
+ - lib/scrum_lint/board_validator.rb
111
+ - lib/scrum_lint/checkers/context_checker.rb
112
+ - lib/scrum_lint/configuration.rb
113
+ - lib/scrum_lint/configurator.rb
114
+ - lib/scrum_lint/models/board.rb
115
+ - lib/scrum_lint/models/card.rb
116
+ - lib/scrum_lint/models/list.rb
117
+ - lib/scrum_lint/runner.rb
118
+ - lib/scrum_lint/version.rb
119
+ homepage: https://github.com/ChalkSchools/scrum-lint
120
+ licenses:
121
+ - MIT
122
+ metadata: {}
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '2.1'
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project:
139
+ rubygems_version: 2.4.8
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: Toolkit to help manage a very specific Trello workflow
143
+ test_files: []