Skip to content
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

Add an optional configuration file #5

Closed
e7e6 opened this issue Dec 14, 2017 · 1 comment
Closed

Add an optional configuration file #5

e7e6 opened this issue Dec 14, 2017 · 1 comment

Comments

@e7e6
Copy link
Collaborator

e7e6 commented Dec 14, 2017

Command-line parameters should be made available in a separate configuration file. Users should be able to edit:

  • all command line switches;
  • how a language should be parsed. For example, how to look for sql strings in a php file.

Here is an example of such a file:

# --------------------------
# code2pg configuration file
# --------------------------

# Lines will be of the form:
#
#       setting = value
#
# Comments start with a '#' and whitespace might be used.

# -----------------------------------------------------------------------------
# GENERAL PARAMETERS
# -----------------------------------------------------------------------------

# directory = .           # the directory to analyze
# directorytype = file    # file, svn
                          # the type of directory that will be analyzed

# format = html           # txt, html or minimal
                          # the assessment report format. Both text and minimal 
                          # will output to the console.
# output-file = estimation.html # the name of the html report
# output-directory = .    # the directory where the report will be generated.
# csv-output = myfile.csv # Oracle keywords can be redirected to this csv file.

# orafce = off            # should the migration use orafce ? If so, those 
                          # instructions will be removed from the assessment.

# tagfiles = off          # if enabled, the local source files will be modified
                          # and comments added where Oracle instructions were
                          # found.

# level1-minutes = 1      # how many minutes it takes to migrate a level 1 
# level2-minutes = 4      # instruction. Same for level2/3/4.
# level3-minutes = 8
# level4-minutes = 16

# minutes-per-workday = 360 # number of worked minutes per day.

# -----------------------------------------------------------------------------
# AUTHENTIFICATION
# -----------------------------------------------------------------------------

# For directories that require authentication (so far only SVN),
# credentials could be given.

# username = myuser       # your username 
# password = mypwd        # your password

# -----------------------------------------------------------------------------
# FILES AND LANGUAGES TO ANALYZE
# -----------------------------------------------------------------------------

# code2pg needs to know which file to analyze and the corresponding language.
# One type of extension can be analyzed at a time, or multiple extensions at 
# the same time. In this case, for each value

# Example (only .sql files will be analyzed and the language will be plsql):
# extensions = sql
# languages  = plsql

# Example (.sql will be considered plsql files, jsp will be considered java 
# files etc...)
# extensions = sql, properties, java, jsp
# languages  = plsql, plsql, java, java

# extensions = java
# languages  = java      # java, javascript, jsp, plsql, proc
e7e6 added a commit that referenced this issue Mar 6, 2018
It's now possible to use a configuration file.
Refactoring after perlcritic tests.
Code cleanup.
@e7e6
Copy link
Collaborator Author

e7e6 commented Mar 6, 2018

This is finally corrected with commit 0be10e3.
A new issue will be open concerning the ability to define a new language (comments and how keywords are identified).

@e7e6 e7e6 closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant