-
Notifications
You must be signed in to change notification settings - Fork 119
Mark non-documented API as explicitly private #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,44 +13,58 @@ | |
| module Packwerk | ||
| extend ActiveSupport::Autoload | ||
|
|
||
| # Public APIs | ||
| autoload :Checker | ||
| autoload :Cli | ||
| autoload :Offense | ||
| autoload :OffensesFormatter | ||
| autoload :OutputStyle | ||
| autoload :Package | ||
| autoload :PackageSet | ||
| autoload :PackageTodo | ||
| autoload :Parsers | ||
| autoload :Reference | ||
| autoload :ReferenceOffense | ||
| autoload :Validator | ||
| autoload :Version | ||
|
|
||
| # Private APIs | ||
| # Please submit an issue if you have a use-case for these | ||
| autoload :ApplicationLoadPaths | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is more easily read commit by commit. A previous commit sorts these then another separates them. |
||
| autoload :ApplicationValidator | ||
| autoload :AssociationInspector | ||
| autoload :OffenseCollection | ||
| autoload :Cache | ||
| autoload :Checker | ||
| autoload :Cli | ||
| autoload :Configuration | ||
| autoload :ConstantDiscovery | ||
| autoload :ConstantNameInspector | ||
| autoload :ConstNodeInspector | ||
| autoload :PackageTodo | ||
| autoload :ExtensionLoader | ||
| autoload :FileProcessor | ||
| autoload :FilesForProcessing | ||
| autoload :Graph | ||
| autoload :Loader | ||
| autoload :Node | ||
| autoload :NodeHelpers | ||
| autoload :NodeProcessor | ||
| autoload :NodeProcessorFactory | ||
| autoload :NodeVisitor | ||
| autoload :Offense | ||
| autoload :OffensesFormatter | ||
| autoload :OutputStyle | ||
| autoload :Package | ||
| autoload :PackageSet | ||
| autoload :OffenseCollection | ||
| autoload :ParsedConstantDefinitions | ||
| autoload :Parsers | ||
| autoload :ParseRun | ||
| autoload :UnresolvedReference | ||
| autoload :Reference | ||
| autoload :ReferenceExtractor | ||
| autoload :ReferenceOffense | ||
| autoload :Result | ||
| autoload :RunContext | ||
| autoload :Validator | ||
| autoload :Version | ||
| autoload :UnresolvedReference | ||
|
|
||
| module Validator | ||
| extend ActiveSupport::Autoload | ||
|
|
||
| autoload :Result | ||
| end | ||
|
|
||
| class Cli | ||
| extend ActiveSupport::Autoload | ||
|
|
||
| autoload :Result | ||
| end | ||
|
|
||
| module OutputStyles | ||
| extend ActiveSupport::Autoload | ||
|
|
@@ -69,13 +83,17 @@ module Formatters | |
| autoload :ProgressFormatter | ||
| end | ||
|
|
||
| private_constant :Formatters | ||
|
|
||
| module Generators | ||
| extend ActiveSupport::Autoload | ||
|
|
||
| autoload :ConfigurationFile | ||
| autoload :RootPackage | ||
| end | ||
|
|
||
| private_constant :Generators | ||
|
|
||
| module ReferenceChecking | ||
| extend ActiveSupport::Autoload | ||
|
|
||
|
|
@@ -89,17 +107,18 @@ module Checkers | |
| end | ||
| end | ||
|
|
||
| private_constant :ReferenceChecking | ||
|
|
||
| class ApplicationValidator | ||
| extend ActiveSupport::Autoload | ||
|
|
||
| autoload :Result | ||
| autoload :Helpers | ||
| end | ||
| end | ||
|
|
||
| # Required to register the default OffensesFormatter | ||
| # Required to register the DefaultOffensesFormatter | ||
| # We put this at the *end* of the file to specify all autoloads first | ||
| require "packwerk/formatters/offenses_formatter" | ||
| require "packwerk/formatters/default_offenses_formatter" | ||
|
|
||
| # Required to register the default DependencyChecker | ||
| require "packwerk/reference_checking/checkers/dependency_checker" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,4 +70,6 @@ def assert_load_paths_present(paths) | |
| end | ||
| end | ||
| end | ||
|
|
||
| private_constant :ApplicationLoadPaths | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,8 +169,9 @@ def out(out) | |
| puts(out) | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| private_constant :Cache | ||
| private_constant :Debug | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # typed: strict | ||
| # frozen_string_literal: true | ||
|
|
||
| module Packwerk | ||
| class Cli | ||
| class Result < T::Struct | ||
| const :message, String | ||
| const :status, T::Boolean | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose these APIs with these rationales:
Checker
API for extending checkers
Cli
Main API for calling packwerk right now. Eventually we might want API like
Packwerk.checkinstead of using the CLI, but this is the de-facto API.Offense
Part of the interface for
OffensesFormatterOffensesFormatter
API for extending offenses formatter
OutputStyle
Implementation of this needs to be passed into CLI
Package, PackageSet, PackageTodo
API for getting information about YML files
Parsers
Contains documented API for
Packwerk::Parsers::Factory.erb_parser_class=(...), which is the current API for substituting the ERB parser.The hope is that #243 will allow us to mark this API as private.
This module also contains
ParserInterfaceas well. With the above PR, we'd allow the interface to be public but the rest to be private.Reference, ReferenceOffense
Part of the API to
CheckerResult
Return value of CLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Result is overloaded, I vote to nest the toplevel result in CLI. We should also nest the app validator result in Validator instead, especially if we use it in the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah makes sense, changed!