Commit graph

7 commits

Author SHA1 Message Date
Dan Anglin 71d62ecaf6
refactor: add golangci-lint with code refactoring
Add golangci-lint for linting and refactor the code based on the
feedback from running it.

Changes:

- Add configuration for golangci-lint.
- Break the large function in create.go into smaller ones.
- Rename internal/templateFuncs to internal/templatefuncs to remove
  upper case letters in the package name.
- Add a mage target for lint tests.
2023-08-21 03:07:06 +01:00
Dan Anglin 8a530551c2
fix: create separate types for work and education
Create separate types for education and employment to fix the issue
where unnecessary fields are created under both education and employment
when a new CV is created.
2023-08-19 00:29:55 +01:00
Dan Anglin 9e0f5af2e6
fix: use JSON schema to auto-generate the CV type
- Use go generate and a third party tool called jsonschemagen to
  auto-generate the CV data type from the JSON schema.
- Update the schema by changing number to integer to ensure that the
  integers are set to the correct type.
- Refactor some code.
2023-08-18 23:47:41 +01:00
Dan Anglin c53978cd91
feat: add a field for location type, code refactor
- feat: add a field for the type of work location (e.g. hybrid)
- refactor: move the Tex and PDF generating code to a new internal
  package which also moves the templates there as well.
- fix: add a default value for the --output field for the generate
  command.
- fix: add an error for when the user does not specify an input file
  when generating the PDF.
- fix: the package name for each of the files in the templateFuncs
  package.
2023-08-15 17:25:00 +01:00
Dan Anglin 36acb1a324
feat: add create subcommand and FlagSet
- Add a new subcommand and FlagSet for creating new CV JSON files.
- fix: close the file after reading the CV.
2023-08-12 09:43:45 +01:00
Dan Anglin cee274318d
feat: add FlagSets to create new subcommands
Create new FlagSets to create new subcommands.

- The version subcommand prints the version and build info.
- The generate subcommand generates the CV PDF documentation.
2023-08-11 18:33:26 +01:00
Dan Anglin fa8dbe68e9
feat(BREAKING): limit shown employment history
Allow users to limit the amount of employment history shown in the PDF
document by specifying a time range. This is a breaking change as the
structure of the CV needs to slightly change. The employment's start and
end dates need to be represented as integers.

Additional refactoring:

- The CV type is now in the internal cv package.
- The template functions are now in the internal templateFuncs package.
2023-03-02 17:40:04 +00:00