Commit Graph

137 Commits

Author SHA1 Message Date
Eric Putnam
587557e1ac
Refactor generation code and allow custom sections
There's a lot in this PR.
- Added a Section class to more easily make the other changes and
  hopefully add flexibility for the future
- Added an option called `configure_sections` that allows you create
  your own custom sections. It blows away all other sections and uses
only the ones you give it.
- Added an option called `add_sections` that allows you to add_sections
  to the default section set
- Added an option called `include_merged` that can be used when
  configure_sections is defined. Configure sections blows away any and
all default sections so to get this one back, you have to set this
option.
- Added tests for this stuff

@HAIL9000 was a co-author. Because of a little git snafu, I accidentally
squashed all of our work into one so it looks like it was just me.

---

Refactor details:

Before this change, the code in generator.rb and generator_generation.rb was conflated and
method call flow went back and forth between the two files seemingly
randomly. They also both defined the exact same class, which is
un-ruby-ish. I tried to separate methods used for the whole changelog
generation from methods used for specific parts of the changelog and
move them into specific classes.

I reasoned that a changelog is a series of "entries" of all tagged
releases plus an extra entry for the unreleased entry. Each entry is
comprised of a header and a series of "sections" for that entry. Each
section is comprized of a list of issues and/or pull requests for that
entry. So the log contains entries, entries contain sections, and
sections contain issues & prs. I have structured the classes around this idea.

- lib/github_changelog_generator/generator/generator.rb is for code
related to generating the entire changelog.
- lib/github_changelog_generator/generator/entry.rb is for code related
to generating entries.
- lib/github_changelog_generator/generator/section.rb is for code
relating to geneating entry sections.

Issues and PRs are already special objects, so it doesn't make sense to
break those out into their own class.
2017-12-14 16:13:41 -08:00
Saugat Acharya
d9cf6ffd94 Make 'change log' a single word (#579) 2017-12-13 22:06:00 +01:00
Olle Jonsson
4465adf943 Linting 2017-10-27 09:29:17 +02:00
Olle Jonsson
5834fd3766 Update parser.rb 2017-10-27 09:28:52 +02:00
Olle Jonsson
b486425af1 Parser: less wordy output 2017-10-27 09:28:52 +02:00
Olle Jonsson
91ac00c1d3 Abort with friendly message on no user or project 2017-10-27 09:28:52 +02:00
Olle Jonsson
4f640b74ac Aborting prints all of usage 2017-10-27 09:28:52 +02:00
Olle Jonsson
faf2ddd552 Linting 2017-10-27 08:49:52 +02:00
Olle Jonsson
5bb4d51b96 Options#print_options: tell don't ask 2017-10-14 21:52:26 +02:00
Olle Jonsson
1fac4efe47 [docs] API docs for Options, Parser
- shorten implementation of print_options
2017-10-14 21:28:02 +02:00
Olle Jonsson
ad0d972ed9 Add option --require to load custom Ruby code (#574) 2017-10-14 21:00:56 +02:00
Tim Meusel
21ec2db39b Add breaking-changes section to changelog (#530)
* add breaking-changes section to changelog

* Clean up parse_by_sections

* Thank you bastelfreak and ekohl!
2017-10-10 20:27:23 +02:00
Olle Jonsson
b36d85eb53 Drop Project-and-Username-finding code (#451)
* Remove Project-and-Username finding code and usages

* Remove "github_remote" option, now unused

* Update README: Usage has changed
2017-10-10 19:53:21 +02:00
Olle Jonsson
9662c935c3 RuboCop 0.50.0; lints 2017-09-18 21:14:47 +02:00
Thom May
b1121cb1ee
Use our default labels across the board
Signed-off-by: Thom May <thom@chef.io>
2017-07-27 10:44:00 -07:00
Lucas Huang
e9ee9556ce remove --between_tags option (#501) 2017-05-25 00:29:31 +02:00
Olle Jonsson
26b124a67c bundled cacert.pem with --ssl-ca-file PATH option (#480)
* Add a bundled cacert.pem from curl's website
* Using the --ssl-ca-file PATH option overrides ENV var SSL_CA_PATH
* Having none of those allow you to use the default, the bundled cacert.pem
* Octokit's SSL config uses this new setting
* Rake task to update_ssl_ca_file
* Rubocop target 2.2
2017-05-24 23:43:31 +02:00
Lucas Huang
9bbfa3add5 Rescue invalid commands and present the valid options list (#498)
* rescue invalid commands

* recuse invalid command
2017-05-14 21:30:43 +02:00
Olle Jonsson
d334aa01f2 Option parsing: Remove tag1, tag2 cruft (#479) 2017-02-08 21:58:30 +01:00
Olle Jonsson
8d74965019 Create temporary cache files in Dir.tmpdir (#459)
* OctoFetcher: http_cache options conditional
* Locate cache directory using Dir.tmpdir
* Cache files options can not have defaults
2017-02-08 18:14:02 +01:00
Olle Jonsson
1dc33e3005 Option --unreleased-label explained 2016-11-04 22:53:49 +01:00
aih
1fd341d9bf Add option to show selected labels in the issue line: --issue-line-labels 2016-10-26 09:50:54 -07:00
Andrew Waage
134d10bab0 some rubocop updates 2016-10-20 11:49:02 -07:00
Olle Jonsson
e123466b82 Linting 2016-10-05 23:31:19 +02:00
Olle Jonsson
43a6e49055 Options: a class to wrap Hash-accessing options choices
- protects against bad names
2016-10-05 23:10:21 +02:00
Olle Jonsson
d8b34169a3 Linting 2016-09-29 23:09:04 +02:00
Andrew Waage
41271b1ecb cleaned up caching and added to options parser 2016-09-29 23:09:04 +02:00
Olle Jonsson
04215618a2 Lint: frozen-string-literal 2016-09-22 19:16:29 +02:00
Petr Korolev
74882ef900 fix quote escape 2016-07-22 09:28:06 +03:00
Petr Korolev
939f6fd768 THis fix #397 2016-07-21 17:48:46 +03:00
Petr Korolev
f32a02a75b remove unused puts 2016-07-21 17:47:53 +03:00
Petr Korolev
4f57845465 rename methods to match of it's actions 2016-07-21 17:47:52 +03:00
Olle Jonsson
9acfcf103c Merge pull request #391 from olleolleolle/feature/parser-docstrings
Parser: YARD docstrings and a rename, and RegExp named capture groups
2016-07-14 00:34:44 +02:00
Olle Jonsson
58bfa047c4 Option usernames_as_github_logins: Mention Markdown 2016-07-02 17:19:54 +02:00
phase
59db1c7821 CLI option for GitHub tags
Not actually implemented yet
2016-07-02 17:10:56 +02:00
Olle Jonsson
b63d9d623e Parser: RegExp with named capture groups 2016-07-02 10:49:49 +02:00
Olle Jonsson
d9e2cdeeac Parser: YARD docstrings and a rename 2016-07-02 10:33:15 +02:00
Petr Korolev
519ca91cd7 Merge pull request #320 from ITV/filter-tags
Added tag exclusion with a filter (string or regex)
2016-03-28 13:04:06 +03:00
Adam
6a0ade1194 refactor 2016-03-24 12:22:33 +00:00
retorquere
a282e6c53e YAML front matter 2016-02-03 13:56:44 +01:00
soundstep
1bae4ea204 filter-tags - Rename option. 2016-01-22 15:11:12 +00:00
soundstep
40dec5346b filter-tags - Added capability to exclude tags with a regular expression by filtering names. 2016-01-22 13:32:31 +00:00
Olle Jonsson
53df784ec3 Parser: avoid Ruby exit
- made the method take three arguments
- specs all note these three
2016-01-05 21:58:13 +01:00
Steve Gilvarry
06a8fe8169 Add release-branch option to filter the Pull Requests by those applied on a partcular release branch 2015-11-18 16:56:27 +11:00
Steve Gilvarry
3fdf0c64df Add options to def self.user_and_project_from_git to fix parser.rb:193 wrong number of arguments (1 for 0) 2015-11-12 07:55:54 +11:00
Olle Jonsson
3fb75c825f Lint: rename to avoid getter naming
- fixed Rake task, too
2015-10-22 00:09:25 +02:00
Olle Jonsson
d227464c33 Rubocop: less complex methods
- Changed one thing: failed return value on printing the banner when
    no user or project was found.
2015-10-21 23:42:33 +02:00
Dlani Mendes
6c71cf439a Rspec and README 2015-09-16 16:19:40 -03:00
Dlani Mendes
fbd8207ff4 Auto parse options from file .github_changelog_generator 2015-09-15 13:58:23 -03:00
Petr Korolev
b902897a22 This commit will fix #274. 2015-09-01 09:13:27 +03:00